SlideShare a Scribd company logo
> v <- c(1, 43, 100, 3, 55)
> is.vector(v)
[1] TRUE
> is(v)
[1] "numeric" "vector"
> length(v)
[1] 5
> v
[1] 1 43 100 3 55
> v <- 1
> is.vector(v)
[1] TRUE
> length(v)
[1] 1
> v
[1] 1
Note that a scalar is a vector of length 1.
,
> a = c(1, 3, 5, 7)
> b = c(1, 2, 4, 8)
,
> a = c(1, 3, 5, 7)
> b = c(1, 2, 4, 8)
> 5 * a
[1] 5 15 25 35
> a + b
[1] 2 5 9 15
> a - b
[1] 0 1 1 -1
> a * b
[1] 1 6 20 56
> a / b
[1] 1.000 1.500 1.250 0.875
> a = c(10, 20, 30)
> b = c(1, 2, 3, 4, 5, 6, 7, 8, 9)
> a + b
[1] 11 22 33 14 25 36 17 28 39
> x=c(2,4,6,8,12)
> y=c(2,1,4,7,10)
> x%%y
[1] 0 0 2 1 2
> x %/% y
[1] 1 4 1 1 1
?"+"
> v <- c(1, 34, 100, 3, 26)
> sum(v)
[1] 164
> prod(v)
[1] 265200
> quantile(v)
0% 25% 50% 75% 100%
1 3 26 34 100
…
> w <- c(10, 10.2, 34, 7.35, 0)
> is(w)
[1] "numeric" "vector"
> w <- seq(0,10,2)
> w <- 1:10
> w
[1] 1 2 3 4 5 6 7 8 9 10
> v <- c(TRUE, FALSE, TRUE, TRUE)
> is(v)
[1] "logical" "vector"
> v <- c(TRUE, FALSE, TRUE, TRUE)
> as.numeric(v)
[1] 1 0 1 1
> v <- c(0, 0, 1, 1)
> as.logical(v)
[1] FALSE FALSE TRUE TRUE
> v <- c(10, 10.2, 34, 7.35, 0)
> v < 5
[1] FALSE FALSE FALSE FALSE TRUE
> v >= 10
[1] TRUE TRUE TRUE FALSE FALSE
> v == 0
[1] FALSE FALSE FALSE FALSE TRUE
> v!=0
[1] TRUE TRUE TRUE TRUE FALSE
> v <- c("a", "b", "c", "d", "e")
> is(v)
[1] "character" "vector"
[3] "data.frameRowLabels" "SuperClassMethod"
> v1 <- "ASP Training Workshop"
> v2 <- "24-29 April 2017"
> paste(v1,v2)
[1] "ASP Training Workshop 24-29 April 2017"
> as.numeric(v1)
[1] NA
Warning message:
NAs introduced by coercion
> as.logical(v1)
[1] NA
> v1 <- c(v, 0, 0, v)
> length(v1)
[1] 8
> v
[1] 1 34 100
> v1
[1] 1 34 100 0 0 1 34 100
> v <- c(10, 10.2, 34, 7.35, 0)
> v[1]
[1] 10
> v[c(2, 4)]
[1] 10.20 7.35
> v[c(4, 2)]
[1] 7.35 10.20
> v[-c(2:5)]
[1] 10
> v <- c(10, 10.2, 34, 7.35, 0)
> v[c(TRUE, FALSE, FALSE, FALSE, FALSE)]
[1] 10
v <- c(10, 10.2, 34, 7.35, 0)
# which elements are larger than 9
v > 9
[1] TRUE TRUE TRUE FALSE FALSE
# select elements larger than 9
v[v > 9]
[1] 10.0 10.2 34.0
# or
idx <- v > 9
v[idx]
[1] 10.0 10.2 34.0
v <- c(NA, 10.2, 34, NA, 0)
# select the NA elements
v==NA
[1] NA NA NA NA NA
v=="NA"
[1] NA FALSE FALSE NA FALSE
# neither works because NA is special
v
[1] NA 10.2 34.0 NA 0.0
is.na(v)
[1] TRUE FALSE FALSE TRUE FALSE
# now it's possible to select the NA
v[is.na(v)]
[1] NA NA
v
[1] NA 10.2 34.0 NA 0.0
v[is.na(v)] <- 200
v
[1] 200.0 10.2 34.0 200.0 0.0
v
[1] NA 10.2 34.0 NA 0.0
v[is.na(v)] <- 200
v
[1] 200.0 10.2 34.0 200.0 0.0
v <- rnorm(1000)
plot(v, main="My scatter plot")
v <- rnorm(1000)
plot(v, main="My scatter plot")
hist(v, main="My histogram")
> v <- rnorm(1000, mean=40, sd=5)
> hist(v, main="My histogram")
> plot(density(v), main="My density plot")
v1 <- rnorm(1000)
v2 <- rnorm(1000)
plot(v1, v2, main="Independent variables")
v1 <- rnorm(1000)
v2 <- rnorm(1000, v1)
plot(v1, v2, main="Dependent variables")
v <- c(10, 3, 0, 54.2, 1)
names(v) <- letters[1:5]
v
a b c d e
10.0 3.0 0.0 54.2 1.0
v["c"]
c
0
v[3]
c
0
•
•
•
•
> SOC <- read.csv("MASIS_SOC.csv")
> SOC
Id UpperDepth LowerDepth SOC Lambda tsme
1 4 0 30 12.00032455 0.01 0.003985153
2 7 0 30 3.48365276 0.01 0.002502976
3 8 0 30 2.31341405 0.01 0.002504971
4 9 0 30 1.94142743 0.01 0.002508691
5 10 0 30 1.34296903 0.01 0.002509177
6 11 0 30 2.28793284 0.01 0.002509360
7 12 0 30 2.71584298 0.01 0.002518323
8 13 0 30 4.34011158 0.01 0.002515760
...
> summary(SOC)
Id UpperDepth LowerDepth SOC Lambda
Min. : 4 Min. :0 Min. :30 Min. : 0.000 Min. :0.01
1st Qu.:1878 1st Qu.:0 1st Qu.:30 1st Qu.: 1.006 1st Qu.:0.01
Median :3214 Median :0 Median :30 Median : 1.495 Median :0.01
Mean :3198 Mean :0 Mean :30 Mean : 1.916 Mean :0.01
3rd Qu.:4502 3rd Qu.:0 3rd Qu.:30 3rd Qu.: 2.268 3rd Qu.:0.01
Max. :6539 Max. :0 Max. :30 Max. :50.205 Max. :0.01
NA's :1
tsme
Min. :0.002472
1st Qu.:0.002502
Median :0.002504
Mean :0.002507
3rd Qu.:0.002507
Max. :0.003985
> tail(SOC)
Id UpperDepth LowerDepth SOC Lambda tsme
3257 6531 0 30 0.5698581 0.01 0.002503761
3258 6532 0 30 5.7547935 0.01 0.002505020
3259 6533 0 30 1.6636972 0.01 0.002506451
3260 6535 0 30 1.9226001 0.01 0.002502052
3261 6537 0 30 1.7165334 0.01 0.002502749
3262 6539 0 30 1.3633083 0.01 0.002502855
> dim(SOC)
[1] 3262 7
> dimnames(SOC)
[[1]]
[1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10"
[11] "11" "12" "13" "14" "15" "16" "17" "18" "19" "20"
…
[[2]]
[1] "Id" "UpperDepth" "LowerDepth" "SOC" "Lambda"
[6] "tsme"
> SOC$SOC
[1] 12.00032455 3.48365276 2.31341405 1.94142743 1.34296903 2.28793284
[7] 2.71584298 4.34011158 5.77118126 4.54692240 4.63597793 2.10768409
[13] 3.96522026 4.80577783 3.08891798 4.59635072 1.51213851 1.31937774
[19] 1.64608828 1.63183332 3.93370051 1.89931487 1.70009503 1.68627536
...
> SOC[3, "tsme"]
[1] 0.002504971
> SOC[3,6]
[1] 0.002504971
SOC[, 6]
[1] 0.003985153 0.002502976 0.002504971 0.002508691 0.002509177 0.002509360
[7] 0.002518323 0.002515760 0.002509165 0.002514908 0.002517316 0.002510426
[13] 0.002506018 0.002503509 0.002505200 0.002503669 0.002505983 0.002504586
[19] 0.002504090 0.002506831 0.002507821 0.002505357 0.002505301 0.002507838
[25] 0.002507646 0.002502572 0.002504063 0.002505777 0.002506869 0.002502164
...
You can select multiple rows and columns using
vectors.
> SOC[1:5, c("SOC","tsme")]
SOC tsme
1 12.000325 0.003985153
2 3.483653 0.002502976
3 2.313414 0.002504971
4 1.941427 0.002508691
5 1.342969 0.002509177
Of course you can write values into a data.frame.
We make a copy of SOC (so we don't mess up
the original)
> SOCtemp <- SOC
> SOCtemp[3,"tsme"]
[1] 0.002504971
> SOCtemp[3,"tsme"] <- 1
> SOCtemp[3,"tsme"]
[1] 1
Recycling rules apply if less values are supplied
than selected
> SOCtemp[1:5,"tsme"] <- 1
> SOCtemp[1:5,]
Id UpperDepth LowerDepth SOC Lambda tsme
1 4 0 30 12.000325 0.01 1
2 7 0 30 3.483653 0.01 1
3 8 0 30 2.313414 0.01 1
4 9 0 30 1.941427 0.01 1
5 10 0 30 1.342969 0.01 1
For example, look at the ‘SOC’column. Which of
these is higher than 2?
> SOC$SOC > 2
[1] TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
[13] TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE
[25] TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
[37] FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE
[49] FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE TRUE FALSE TRUE TRUE
[61] TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE
...
We can now use this variable to access only the
rows that have SOC > 2
> SOCHigh <- SOC$SOC > 2
> SOC[SOCHigh,]
Id UpperDepth LowerDepth SOC Lambda tsme
1 4 0 30 12.000325 0.01 0.003985153
2 7 0 30 3.483653 0.01 0.002502976
3 8 0 30 2.313414 0.01 0.002504971
6 11 0 30 2.287933 0.01 0.002509360
7 12 0 30 2.715843 0.01 0.002518323
...
Or do it all at once (in pure R fashion)
> SOC[SOC$SOC > 2,]
Id UpperDepth LowerDepth SOC Lambda tsme
1 4 0 30 12.000325 0.01 0.003985153
2 7 0 30 3.483653 0.01 0.002502976
3 8 0 30 2.313414 0.01 0.002504971
6 11 0 30 2.287933 0.01 0.002509360
7 12 0 30 2.715843 0.01 0.002518323
8 13 0 30 4.340112 0.01 0.002515760
...
Ordering
You can reorder the data.frame by one or more
columns using the order() function
> SOC[order(SOC$tsme),]
Id UpperDepth LowerDepth SOC Lambda tsme
2268 4039 0 30 0.00000000 0.01 0.002472194
145 396 0 30 1.17823531 0.01 0.002479430
1527 2803 0 30 0.45000000 0.01 0.002482055
471 1032 0 30 0.62766244 0.01 0.002482168
1581 3101 0 30 0.92922471 0.01 0.002484241
2237 3996 0 30 1.44240409 0.01 0.002484922
2629 5048 0 30 0.85421359 0.01 0.002485544
1910 3590 0 30 1.45097492 0.01 0.002486062
1650 3234 0 30 0.00000000 0.01 0.002486621
2536 4632 0 30 1.76030792 0.01 0.002486932
...
Ordering
You can reorder the data.frame by one or more
columns using the order() function
> SOC[order(SOC$tsme, SOC$SOC),]
Id UpperDepth LowerDepth SOC Lambda tsme
2268 4039 0 30 0.00000000 0.01 0.002472194
145 396 0 30 1.17823531 0.01 0.002479430
1527 2803 0 30 0.45000000 0.01 0.002482055
471 1032 0 30 0.62766244 0.01 0.002482168
1581 3101 0 30 0.92922471 0.01 0.002484241
2237 3996 0 30 1.44240409 0.01 0.002484922
2629 5048 0 30 0.85421359 0.01 0.002485544
Making your own data.frame is straightforward
using the data.frame() function. For example:
> year <- 2000:2010
> catch <- c(900, 1230, 1400, 930, 670, 1000, 960, 840, 900, 500,400)
> dat <- data.frame(year=year, catch=catch)
> head(dat)
year catch
1 2000 900
2 2001 1230
3 2002 1400
4 2003 930
5 2004 670
6 2005 1000
It's possible to add extra columns of various types
> dat$area <- c("N","S","N","S","N","S","N","S","N","S","N")
> dat$survey <- c(TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE,
TRUE)
> head(dat)
year catch area survey
1 2000 900 N TRUE
2 2001 1230 S FALSE
3 2002 1400 N FALSE
4 2003 930 S TRUE
5 2004 670 N TRUE
6 2005 1000 S TRUE
To add an extra row or rows use rbind and pass in
a data.frame with the exact same column names
and types
> dat2 <- data.frame(year = 1920, catch = 666, area = "N", survey = FALSE)
> dat <- rbind(dat, dat2)
> dat
year catch area survey
1 2000 900 N TRUE
2 2001 1230 S FALSE
3 2002 1400 N FALSE
4 2003 930 S TRUE
5 2004 670 N TRUE
6 2005 1000 S TRUE
7 2006 960 N TRUE
8 2007 840 S TRUE
9 2008 900 N FALSE
10 2009 500 S TRUE
11 2010 400 N TRUE
12 1920 666 N FALSE
Ask at least 4 people near you and make a data.frame to
hold the following information about them: Name, hair
colour, height, shoe size, how long they can hold
their breath for.
• Reorder the data.frame by height.
• Subset the data.frame to only include people taller
than 1m 70.
• What is the mean shoe size of the people in the
data.frame?
• Whose shoe size is closest to the mean shoe size?
We need to talk about factors.
Macedonian Soil Data data.frame
> head(MSoil)
Id UpperDepth LowerDepth SOC Lambda tsme Region
1 4 0 30 12.000325 0.01 0.003985153 A
2 7 0 30 3.483653 0.01 0.002502976 B
3 8 0 30 2.313414 0.01 0.002504971 B
4 9 0 30 1.941427 0.01 0.002508691 B
5 10 0 30 1.342969 0.01 0.002509177 B
6 11 0 30 2.287933 0.01 0.002509360 B
We need to talk about factors. In the Macedonian
Soil Data data.frame Take a look at the ‘Region’
column
> head(MSoil$Region)
[1] A B B B B B
Levels: A B
They look like characters, but no quotes. There are two
“levels”: A and B. What does this mean?
They look like characters, but no quotes. There are two
“levels”: A and B. What does this mean?
> class(MSoil$Region)
[1] "factor"
Factors
Factors are a way of encoding data that can be used for
grouping variables.
Values can only be one of the defined 'levels'. This
allows you to keep track of what the values could be.
They can be used to ensure that a data set is coherent.
For example, if we try to set a value in the
“Region” column to something other than A or B,
we get a warning
> MSoil[1,"Region"] <- "20"
Warning message:
In `[<-.factor`(`*tmp*`, iseq, value = "20") :
invalid factor level, NA generated
And a broken data.frame
> MSoil[1,]
Id UpperDepth LowerDepth SOC Lambda tsme Region
1 4 0 30 12.00032 0.01 0.003985153 <NA>
Let's fix it :)
> MSoil[1,"Region"] <- "A"
> MSoil[1,]
Id UpperDepth LowerDepth SOC Lambda tsme Region
1 4 0 30 12.00032 0.01 0.003985153 A
Factors
If you really wanted to change the value to
something not in the levels you need to change
the levels too (the names of the factors)
> levels(MSoil$Region)
[1] "A" "B"
Factors
If you really wanted to change the value to
something not in the levels you need to change
the levels too (the names of the factors)
> MSoil[1,"Region"] <- "C"
>
> head(MSoil)
Id UpperDepth LowerDepth SOC Lambda tsme Region
1 4 0 30 12.000325 0.01 0.003985153 C
2 7 0 30 3.483653 0.01 0.002502976 B
3 8 0 30 2.313414 0.01 0.002504971 B
4 9 0 30 1.941427 0.01 0.002508691 B
5 10 0 30 1.342969 0.01 0.002509177 B
6 11 0 30 2.287933 0.01 0.002509360 B
Factors
If you really wanted to change the value to
something not in the levels you need to change
the levels too (the names of the factors)
MSoil[, "Region"]
[1] C B B B B B B B B B B B B B B B B B B B B B A A A A A A A A A A A A A A
[37] A B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B A A
...
[973] B B B B B B B B B B B B B B B B B B B B B B B B B B B B
[ reached getOption("max.print") -- omitted 2262 entries ]
Levels: A B C
Factors
Factors are used for many methods and
functions in R, such as linear analysis.
let's make another data set that only includes
Region == B
> MSoilB <- subset(MSoil, Region=="B")
>
> MSoilB$Region
[1] B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B
...
[937] B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B
[973] B B B B B B B B B B B B B B B B B B B B B B B B B B B B
[ reached getOption("max.print") -- omitted 1147 entries ]
Levels: A B C
You can see that we have no observations for A
but you know that there could be. This might be
important for data management. When you import
data into R, some of your columns may be read in
as factors even if you did not intend them to.
The by() function can be used to split the data and apply
a function to each chunk. This can be very useful for
summarising the data. For example, to split the data by
the 'Region' column (into A and B chunks) and take the
mean of the column of each chunk you can do
> by(MSoil$SOC, MSoil$Region, mean)
MSoil$Region: A
[1] NaN
----------------------------------------------------------
MSoil$Region: B
[1] 1.839508
----------------------------------------------------------
MSoil$Region: C
[1] 12.00032
aggregate() does something similar but can be
used to operate on multiple columns in a data
frame.Learning how to manipulate data frames is
a very useful skill.The plyr and reshape packages
are worth your time getting to know.
What is the mean height by hair
colour of the people in your
data.frame?
A list is a very flexible container.
It's like a vector, but the elements can be
objects of any class and size - even lists
(lists f lists of lists of …).
This makes them very handy for moving big
chunks of data around (particularly returning
output from a function).
Here we make two objects to put into a list.
> best_food <- c("cake", "banana")
> odd_numbers <- c(1,3,5,7,9)
> notes <- "Something interesting"
To make the list, we use the list() function.
When you create a list, you should give the
elements names (they don't have to be the name
of the object).
> my_list <- list(food = best_food, numbers = odd_numbers, note
= notes)
> class(my_list)
[1] "list"
Getting the length of the list and the names of the
elements is straightforward
> length(my_list)
[1] 3
Getting the length of the list and the names of the
elements is straightforward
> length(my_list)
[1] 3
> names(my_list)
[1] "food" "numbers" "note
Elements in a list can be extracted using two
methods. By name, using $ and the element
name.
> my_list$food
[1] "cake" "banana"
Accessing data in a list
Using [[ and the element position or name.
> my_list[[1]]
[1] "cake" "banana"
>
> my_list[["food"]]
[1] "cake" "banana"
Modifying lists
Lists can be easily extended - just add an extra
element.
> my_list[["new"]] <- c(1,3,5,7)
> summary(my_list)
Length Class Mode
food 2 -none- character
numbers 5 -none- numeric
note 1 -none- character
new 4 -none- numeric
Processing lists
lapply - apply the same function to each element
in a list.
> vec1 <- seq(from=1, to = 10, length = 7)
> vec2 <- seq(from=12, to = 20, length = 6)
> lst <- list(vec1 = vec1, vec2 = vec2)
> lapply(lst, sum)
$vec1
[1] 38.5
$vec2
[1] 96
Processing lists
This only makes sense if the same function can be
applied to all elements. For example, if we add a
character vector to the list, we can't use sum.But
length makes sense.
> lapply(lst, length)
$vec1
[1] 7
$vec2
[1] 6
$str1
[1] 3
# Exercise 4
Newlist <- list(a=1:10, b="Good morning", c="Hi")
Newlist$a <- Newlist$a + 1
Newlist
## $a
## [1] 2 3 4 5 6 7 8 9 10 11
##
## $b
## [1] "Good morning"
##
## $c
## [1] "Hi"
6. Vectors – Data Frames

More Related Content

What's hot

Algorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical FileAlgorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical File
KushagraChadha1
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadratures
Tarun Gehlot
 
Comparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimizationComparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimizationPranamesh Chakraborty
 
Time series-mining-slides
Time series-mining-slidesTime series-mining-slides
Time series-mining-slides
Yanchang Zhao
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
vishal kathiriya
 
基礎からのベイズ統計学 輪読会資料 第8章 「比率・相関・信頼性」
基礎からのベイズ統計学 輪読会資料  第8章 「比率・相関・信頼性」基礎からのベイズ統計学 輪読会資料  第8章 「比率・相関・信頼性」
基礎からのベイズ統計学 輪読会資料 第8章 「比率・相関・信頼性」
Ken'ichi Matsui
 
Stochastic methods for uncertainty quantification in numerical aerodynamics
Stochastic methods for uncertainty quantification in numerical aerodynamicsStochastic methods for uncertainty quantification in numerical aerodynamics
Stochastic methods for uncertainty quantification in numerical aerodynamics
Alexander Litvinenko
 
Day 1c access, select ordering copy.pptx
Day 1c   access, select   ordering copy.pptxDay 1c   access, select   ordering copy.pptx
Day 1c access, select ordering copy.pptx
Adrien Melquiond
 
E33018021
E33018021E33018021
E33018021
IJERA Editor
 
【演習】Re:ゲーム理論入門 第11回 -非協力ゲームにおける交渉ゲーム-
【演習】Re:ゲーム理論入門 第11回 -非協力ゲームにおける交渉ゲーム-【演習】Re:ゲーム理論入門 第11回 -非協力ゲームにおける交渉ゲーム-
【演習】Re:ゲーム理論入門 第11回 -非協力ゲームにおける交渉ゲーム-
ssusere0a682
 
Tetsunao Matsuta
Tetsunao MatsutaTetsunao Matsuta
Tetsunao Matsuta
Suurist
 
Final Exam Review (Integration)
Final Exam Review (Integration)Final Exam Review (Integration)
Final Exam Review (Integration)
Matthew Leingang
 
Hideitsu Hino
Hideitsu HinoHideitsu Hino
Hideitsu Hino
Suurist
 
Oracle 12c SQL: Date Ranges
Oracle 12c SQL: Date RangesOracle 12c SQL: Date Ranges
Oracle 12c SQL: Date Ranges
Stew Ashton
 
Ranges, ranges everywhere (Oracle SQL)
Ranges, ranges everywhere (Oracle SQL)Ranges, ranges everywhere (Oracle SQL)
Ranges, ranges everywhere (Oracle SQL)
Stew Ashton
 
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
Ken'ichi Matsui
 
Chapter 6 indices
Chapter 6 indicesChapter 6 indices
Chapter 6 indices
Jasimah Puari
 
Hand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionHand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th edition
PriSim
 
Calculus 10th edition anton solutions manual
Calculus 10th edition anton solutions manualCalculus 10th edition anton solutions manual
Calculus 10th edition anton solutions manual
Reece1334
 

What's hot (20)

Algorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical FileAlgorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical File
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadratures
 
Comparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimizationComparative study of algorithms of nonlinear optimization
Comparative study of algorithms of nonlinear optimization
 
Time series-mining-slides
Time series-mining-slidesTime series-mining-slides
Time series-mining-slides
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
 
Numerical Methods Solving Linear Equations
Numerical Methods Solving Linear EquationsNumerical Methods Solving Linear Equations
Numerical Methods Solving Linear Equations
 
基礎からのベイズ統計学 輪読会資料 第8章 「比率・相関・信頼性」
基礎からのベイズ統計学 輪読会資料  第8章 「比率・相関・信頼性」基礎からのベイズ統計学 輪読会資料  第8章 「比率・相関・信頼性」
基礎からのベイズ統計学 輪読会資料 第8章 「比率・相関・信頼性」
 
Stochastic methods for uncertainty quantification in numerical aerodynamics
Stochastic methods for uncertainty quantification in numerical aerodynamicsStochastic methods for uncertainty quantification in numerical aerodynamics
Stochastic methods for uncertainty quantification in numerical aerodynamics
 
Day 1c access, select ordering copy.pptx
Day 1c   access, select   ordering copy.pptxDay 1c   access, select   ordering copy.pptx
Day 1c access, select ordering copy.pptx
 
E33018021
E33018021E33018021
E33018021
 
【演習】Re:ゲーム理論入門 第11回 -非協力ゲームにおける交渉ゲーム-
【演習】Re:ゲーム理論入門 第11回 -非協力ゲームにおける交渉ゲーム-【演習】Re:ゲーム理論入門 第11回 -非協力ゲームにおける交渉ゲーム-
【演習】Re:ゲーム理論入門 第11回 -非協力ゲームにおける交渉ゲーム-
 
Tetsunao Matsuta
Tetsunao MatsutaTetsunao Matsuta
Tetsunao Matsuta
 
Final Exam Review (Integration)
Final Exam Review (Integration)Final Exam Review (Integration)
Final Exam Review (Integration)
 
Hideitsu Hino
Hideitsu HinoHideitsu Hino
Hideitsu Hino
 
Oracle 12c SQL: Date Ranges
Oracle 12c SQL: Date RangesOracle 12c SQL: Date Ranges
Oracle 12c SQL: Date Ranges
 
Ranges, ranges everywhere (Oracle SQL)
Ranges, ranges everywhere (Oracle SQL)Ranges, ranges everywhere (Oracle SQL)
Ranges, ranges everywhere (Oracle SQL)
 
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
 
Chapter 6 indices
Chapter 6 indicesChapter 6 indices
Chapter 6 indices
 
Hand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionHand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th edition
 
Calculus 10th edition anton solutions manual
Calculus 10th edition anton solutions manualCalculus 10th edition anton solutions manual
Calculus 10th edition anton solutions manual
 

Similar to 6. Vectors – Data Frames

R Programming Homework Help
R Programming Homework HelpR Programming Homework Help
R Programming Homework Help
Statistics Homework Helper
 
R Activity in Biostatistics
R Activity in BiostatisticsR Activity in Biostatistics
R Activity in Biostatistics
Larry Sultiz
 
제 6회 엑셈 수요 세미나 자료 연구컨텐츠팀
제 6회 엑셈 수요 세미나 자료 연구컨텐츠팀제 6회 엑셈 수요 세미나 자료 연구컨텐츠팀
제 6회 엑셈 수요 세미나 자료 연구컨텐츠팀
EXEM
 
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
stewashton
 
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docxmetadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
ARIV4
 
response of system for given transfer function
response of system for given transfer functionresponse of system for given transfer function
response of system for given transfer function
Denishthummar
 
R programming language
R programming languageR programming language
R programming language
Alberto Minetti
 
Model Presolve, Warmstart and Conflict Refining in CP Optimizer
Model Presolve, Warmstart and Conflict Refining in CP OptimizerModel Presolve, Warmstart and Conflict Refining in CP Optimizer
Model Presolve, Warmstart and Conflict Refining in CP Optimizer
Philippe Laborie
 
histgram[1].ppt
histgram[1].ppthistgram[1].ppt
histgram[1].ppt
ssuserb036e8
 
Pajek chapter2 Attributes and Relations
Pajek chapter2 Attributes and RelationsPajek chapter2 Attributes and Relations
Pajek chapter2 Attributes and RelationsChengjun Wang
 
R part II
R part IIR part II
R part II
Ruru Chowdhury
 
Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01Sunil0108
 
Table of Useful R commands.
Table of Useful R commands.Table of Useful R commands.
Table of Useful R commands.
Dr. Volkan OBAN
 
RDataMining slides-time-series-analysis
RDataMining slides-time-series-analysisRDataMining slides-time-series-analysis
RDataMining slides-time-series-analysis
Yanchang Zhao
 
Writing DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby ConfWriting DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby Conf
Jason Garber
 
IBM Infosphere Datastage Interview Questions-1.pdf
IBM Infosphere Datastage Interview Questions-1.pdfIBM Infosphere Datastage Interview Questions-1.pdf
IBM Infosphere Datastage Interview Questions-1.pdf
SrawanSinghRao1
 
第3回 データフレームの基本操作 その1(解答付き)
第3回 データフレームの基本操作 その1(解答付き)第3回 データフレームの基本操作 その1(解答付き)
第3回 データフレームの基本操作 その1(解答付き)
Wataru Shito
 
MATLAB ARRAYS
MATLAB ARRAYSMATLAB ARRAYS
MATLAB ARRAYS
Aditya Choudhury
 

Similar to 6. Vectors – Data Frames (20)

R Programming Homework Help
R Programming Homework HelpR Programming Homework Help
R Programming Homework Help
 
R Activity in Biostatistics
R Activity in BiostatisticsR Activity in Biostatistics
R Activity in Biostatistics
 
제 6회 엑셈 수요 세미나 자료 연구컨텐츠팀
제 6회 엑셈 수요 세미나 자료 연구컨텐츠팀제 6회 엑셈 수요 세미나 자료 연구컨텐츠팀
제 6회 엑셈 수요 세미나 자료 연구컨텐츠팀
 
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
 
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docxmetadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
 
response of system for given transfer function
response of system for given transfer functionresponse of system for given transfer function
response of system for given transfer function
 
5431305022
54313050225431305022
5431305022
 
R programming language
R programming languageR programming language
R programming language
 
Model Presolve, Warmstart and Conflict Refining in CP Optimizer
Model Presolve, Warmstart and Conflict Refining in CP OptimizerModel Presolve, Warmstart and Conflict Refining in CP Optimizer
Model Presolve, Warmstart and Conflict Refining in CP Optimizer
 
Hta r31
Hta r31Hta r31
Hta r31
 
histgram[1].ppt
histgram[1].ppthistgram[1].ppt
histgram[1].ppt
 
Pajek chapter2 Attributes and Relations
Pajek chapter2 Attributes and RelationsPajek chapter2 Attributes and Relations
Pajek chapter2 Attributes and Relations
 
R part II
R part IIR part II
R part II
 
Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01
 
Table of Useful R commands.
Table of Useful R commands.Table of Useful R commands.
Table of Useful R commands.
 
RDataMining slides-time-series-analysis
RDataMining slides-time-series-analysisRDataMining slides-time-series-analysis
RDataMining slides-time-series-analysis
 
Writing DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby ConfWriting DSLs with Parslet - Wicked Good Ruby Conf
Writing DSLs with Parslet - Wicked Good Ruby Conf
 
IBM Infosphere Datastage Interview Questions-1.pdf
IBM Infosphere Datastage Interview Questions-1.pdfIBM Infosphere Datastage Interview Questions-1.pdf
IBM Infosphere Datastage Interview Questions-1.pdf
 
第3回 データフレームの基本操作 その1(解答付き)
第3回 データフレームの基本操作 その1(解答付き)第3回 データフレームの基本操作 その1(解答付き)
第3回 データフレームの基本操作 その1(解答付き)
 
MATLAB ARRAYS
MATLAB ARRAYSMATLAB ARRAYS
MATLAB ARRAYS
 

More from FAO

Nigeria
NigeriaNigeria
Nigeria
FAO
 
Niger
NigerNiger
Niger
FAO
 
Namibia
NamibiaNamibia
Namibia
FAO
 
Mozambique
MozambiqueMozambique
Mozambique
FAO
 
Zimbabwe takesure
Zimbabwe takesureZimbabwe takesure
Zimbabwe takesure
FAO
 
Zimbabwe
ZimbabweZimbabwe
Zimbabwe
FAO
 
Zambia
ZambiaZambia
Zambia
FAO
 
Togo
TogoTogo
Togo
FAO
 
Tanzania
TanzaniaTanzania
Tanzania
FAO
 
Spal presentation
Spal presentationSpal presentation
Spal presentation
FAO
 
Rwanda
RwandaRwanda
Rwanda
FAO
 
Nigeria uponi
Nigeria uponiNigeria uponi
Nigeria uponi
FAO
 
The multi-faced role of soil in the NENA regions (part 2)
The multi-faced role of soil in the NENA regions (part 2)The multi-faced role of soil in the NENA regions (part 2)
The multi-faced role of soil in the NENA regions (part 2)
FAO
 
The multi-faced role of soil in the NENA regions (part 1)
The multi-faced role of soil in the NENA regions (part 1)The multi-faced role of soil in the NENA regions (part 1)
The multi-faced role of soil in the NENA regions (part 1)
FAO
 
Agenda of the launch of the soil policy brief at the Land&Water Days
Agenda of the launch of the soil policy brief at the Land&Water DaysAgenda of the launch of the soil policy brief at the Land&Water Days
Agenda of the launch of the soil policy brief at the Land&Water Days
FAO
 
Agenda of the 5th NENA Soil Partnership meeting
Agenda of the 5th NENA Soil Partnership meetingAgenda of the 5th NENA Soil Partnership meeting
Agenda of the 5th NENA Soil Partnership meeting
FAO
 
The Voluntary Guidelines for Sustainable Soil Management
The Voluntary Guidelines for Sustainable Soil ManagementThe Voluntary Guidelines for Sustainable Soil Management
The Voluntary Guidelines for Sustainable Soil Management
FAO
 
GLOSOLAN - Mission, status and way forward
GLOSOLAN - Mission, status and way forwardGLOSOLAN - Mission, status and way forward
GLOSOLAN - Mission, status and way forward
FAO
 
Towards a Global Soil Information System (GLOSIS)
Towards a Global Soil Information System (GLOSIS)Towards a Global Soil Information System (GLOSIS)
Towards a Global Soil Information System (GLOSIS)
FAO
 
GSP developments of regional interest in 2019
GSP developments of regional interest in 2019GSP developments of regional interest in 2019
GSP developments of regional interest in 2019
FAO
 

More from FAO (20)

Nigeria
NigeriaNigeria
Nigeria
 
Niger
NigerNiger
Niger
 
Namibia
NamibiaNamibia
Namibia
 
Mozambique
MozambiqueMozambique
Mozambique
 
Zimbabwe takesure
Zimbabwe takesureZimbabwe takesure
Zimbabwe takesure
 
Zimbabwe
ZimbabweZimbabwe
Zimbabwe
 
Zambia
ZambiaZambia
Zambia
 
Togo
TogoTogo
Togo
 
Tanzania
TanzaniaTanzania
Tanzania
 
Spal presentation
Spal presentationSpal presentation
Spal presentation
 
Rwanda
RwandaRwanda
Rwanda
 
Nigeria uponi
Nigeria uponiNigeria uponi
Nigeria uponi
 
The multi-faced role of soil in the NENA regions (part 2)
The multi-faced role of soil in the NENA regions (part 2)The multi-faced role of soil in the NENA regions (part 2)
The multi-faced role of soil in the NENA regions (part 2)
 
The multi-faced role of soil in the NENA regions (part 1)
The multi-faced role of soil in the NENA regions (part 1)The multi-faced role of soil in the NENA regions (part 1)
The multi-faced role of soil in the NENA regions (part 1)
 
Agenda of the launch of the soil policy brief at the Land&Water Days
Agenda of the launch of the soil policy brief at the Land&Water DaysAgenda of the launch of the soil policy brief at the Land&Water Days
Agenda of the launch of the soil policy brief at the Land&Water Days
 
Agenda of the 5th NENA Soil Partnership meeting
Agenda of the 5th NENA Soil Partnership meetingAgenda of the 5th NENA Soil Partnership meeting
Agenda of the 5th NENA Soil Partnership meeting
 
The Voluntary Guidelines for Sustainable Soil Management
The Voluntary Guidelines for Sustainable Soil ManagementThe Voluntary Guidelines for Sustainable Soil Management
The Voluntary Guidelines for Sustainable Soil Management
 
GLOSOLAN - Mission, status and way forward
GLOSOLAN - Mission, status and way forwardGLOSOLAN - Mission, status and way forward
GLOSOLAN - Mission, status and way forward
 
Towards a Global Soil Information System (GLOSIS)
Towards a Global Soil Information System (GLOSIS)Towards a Global Soil Information System (GLOSIS)
Towards a Global Soil Information System (GLOSIS)
 
GSP developments of regional interest in 2019
GSP developments of regional interest in 2019GSP developments of regional interest in 2019
GSP developments of regional interest in 2019
 

Recently uploaded

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 

Recently uploaded (20)

The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 

6. Vectors – Data Frames

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. > v <- c(1, 43, 100, 3, 55) > is.vector(v) [1] TRUE > is(v) [1] "numeric" "vector" > length(v) [1] 5 > v [1] 1 43 100 3 55
  • 7. > v <- 1 > is.vector(v) [1] TRUE > length(v) [1] 1 > v [1] 1 Note that a scalar is a vector of length 1.
  • 8.
  • 9. , > a = c(1, 3, 5, 7) > b = c(1, 2, 4, 8)
  • 10. , > a = c(1, 3, 5, 7) > b = c(1, 2, 4, 8) > 5 * a [1] 5 15 25 35
  • 11. > a + b [1] 2 5 9 15
  • 12. > a - b [1] 0 1 1 -1 > a * b [1] 1 6 20 56 > a / b [1] 1.000 1.500 1.250 0.875
  • 13. > a = c(10, 20, 30) > b = c(1, 2, 3, 4, 5, 6, 7, 8, 9) > a + b [1] 11 22 33 14 25 36 17 28 39
  • 14. > x=c(2,4,6,8,12) > y=c(2,1,4,7,10) > x%%y [1] 0 0 2 1 2 > x %/% y [1] 1 4 1 1 1
  • 15. ?"+"
  • 16. > v <- c(1, 34, 100, 3, 26) > sum(v) [1] 164 > prod(v) [1] 265200 > quantile(v) 0% 25% 50% 75% 100% 1 3 26 34 100
  • 17.
  • 18. > w <- c(10, 10.2, 34, 7.35, 0) > is(w) [1] "numeric" "vector" > w <- seq(0,10,2) > w <- 1:10 > w [1] 1 2 3 4 5 6 7 8 9 10
  • 19. > v <- c(TRUE, FALSE, TRUE, TRUE) > is(v) [1] "logical" "vector"
  • 20. > v <- c(TRUE, FALSE, TRUE, TRUE) > as.numeric(v) [1] 1 0 1 1 > v <- c(0, 0, 1, 1) > as.logical(v) [1] FALSE FALSE TRUE TRUE
  • 21. > v <- c(10, 10.2, 34, 7.35, 0) > v < 5 [1] FALSE FALSE FALSE FALSE TRUE > v >= 10 [1] TRUE TRUE TRUE FALSE FALSE > v == 0 [1] FALSE FALSE FALSE FALSE TRUE > v!=0 [1] TRUE TRUE TRUE TRUE FALSE
  • 22. > v <- c("a", "b", "c", "d", "e") > is(v) [1] "character" "vector" [3] "data.frameRowLabels" "SuperClassMethod"
  • 23. > v1 <- "ASP Training Workshop" > v2 <- "24-29 April 2017" > paste(v1,v2) [1] "ASP Training Workshop 24-29 April 2017"
  • 24. > as.numeric(v1) [1] NA Warning message: NAs introduced by coercion > as.logical(v1) [1] NA
  • 25. > v1 <- c(v, 0, 0, v) > length(v1) [1] 8 > v [1] 1 34 100 > v1 [1] 1 34 100 0 0 1 34 100
  • 26.
  • 27. > v <- c(10, 10.2, 34, 7.35, 0) > v[1] [1] 10 > v[c(2, 4)] [1] 10.20 7.35 > v[c(4, 2)] [1] 7.35 10.20 > v[-c(2:5)] [1] 10
  • 28. > v <- c(10, 10.2, 34, 7.35, 0) > v[c(TRUE, FALSE, FALSE, FALSE, FALSE)] [1] 10
  • 29. v <- c(10, 10.2, 34, 7.35, 0) # which elements are larger than 9 v > 9 [1] TRUE TRUE TRUE FALSE FALSE # select elements larger than 9 v[v > 9] [1] 10.0 10.2 34.0 # or idx <- v > 9 v[idx] [1] 10.0 10.2 34.0
  • 30. v <- c(NA, 10.2, 34, NA, 0) # select the NA elements v==NA [1] NA NA NA NA NA v=="NA" [1] NA FALSE FALSE NA FALSE # neither works because NA is special
  • 31. v [1] NA 10.2 34.0 NA 0.0 is.na(v) [1] TRUE FALSE FALSE TRUE FALSE # now it's possible to select the NA v[is.na(v)] [1] NA NA
  • 32. v [1] NA 10.2 34.0 NA 0.0 v[is.na(v)] <- 200 v [1] 200.0 10.2 34.0 200.0 0.0
  • 33. v [1] NA 10.2 34.0 NA 0.0 v[is.na(v)] <- 200 v [1] 200.0 10.2 34.0 200.0 0.0
  • 34. v <- rnorm(1000) plot(v, main="My scatter plot")
  • 35. v <- rnorm(1000) plot(v, main="My scatter plot")
  • 37. > v <- rnorm(1000, mean=40, sd=5) > hist(v, main="My histogram")
  • 38. > plot(density(v), main="My density plot")
  • 39. v1 <- rnorm(1000) v2 <- rnorm(1000) plot(v1, v2, main="Independent variables")
  • 40. v1 <- rnorm(1000) v2 <- rnorm(1000, v1) plot(v1, v2, main="Dependent variables")
  • 41.
  • 42. v <- c(10, 3, 0, 54.2, 1) names(v) <- letters[1:5] v a b c d e 10.0 3.0 0.0 54.2 1.0 v["c"] c 0 v[3] c 0
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 57. > SOC <- read.csv("MASIS_SOC.csv") > SOC Id UpperDepth LowerDepth SOC Lambda tsme 1 4 0 30 12.00032455 0.01 0.003985153 2 7 0 30 3.48365276 0.01 0.002502976 3 8 0 30 2.31341405 0.01 0.002504971 4 9 0 30 1.94142743 0.01 0.002508691 5 10 0 30 1.34296903 0.01 0.002509177 6 11 0 30 2.28793284 0.01 0.002509360 7 12 0 30 2.71584298 0.01 0.002518323 8 13 0 30 4.34011158 0.01 0.002515760 ...
  • 58. > summary(SOC) Id UpperDepth LowerDepth SOC Lambda Min. : 4 Min. :0 Min. :30 Min. : 0.000 Min. :0.01 1st Qu.:1878 1st Qu.:0 1st Qu.:30 1st Qu.: 1.006 1st Qu.:0.01 Median :3214 Median :0 Median :30 Median : 1.495 Median :0.01 Mean :3198 Mean :0 Mean :30 Mean : 1.916 Mean :0.01 3rd Qu.:4502 3rd Qu.:0 3rd Qu.:30 3rd Qu.: 2.268 3rd Qu.:0.01 Max. :6539 Max. :0 Max. :30 Max. :50.205 Max. :0.01 NA's :1 tsme Min. :0.002472 1st Qu.:0.002502 Median :0.002504 Mean :0.002507 3rd Qu.:0.002507 Max. :0.003985
  • 59. > tail(SOC) Id UpperDepth LowerDepth SOC Lambda tsme 3257 6531 0 30 0.5698581 0.01 0.002503761 3258 6532 0 30 5.7547935 0.01 0.002505020 3259 6533 0 30 1.6636972 0.01 0.002506451 3260 6535 0 30 1.9226001 0.01 0.002502052 3261 6537 0 30 1.7165334 0.01 0.002502749 3262 6539 0 30 1.3633083 0.01 0.002502855
  • 61. > dimnames(SOC) [[1]] [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" [11] "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" … [[2]] [1] "Id" "UpperDepth" "LowerDepth" "SOC" "Lambda" [6] "tsme"
  • 62. > SOC$SOC [1] 12.00032455 3.48365276 2.31341405 1.94142743 1.34296903 2.28793284 [7] 2.71584298 4.34011158 5.77118126 4.54692240 4.63597793 2.10768409 [13] 3.96522026 4.80577783 3.08891798 4.59635072 1.51213851 1.31937774 [19] 1.64608828 1.63183332 3.93370051 1.89931487 1.70009503 1.68627536 ...
  • 63. > SOC[3, "tsme"] [1] 0.002504971
  • 65. SOC[, 6] [1] 0.003985153 0.002502976 0.002504971 0.002508691 0.002509177 0.002509360 [7] 0.002518323 0.002515760 0.002509165 0.002514908 0.002517316 0.002510426 [13] 0.002506018 0.002503509 0.002505200 0.002503669 0.002505983 0.002504586 [19] 0.002504090 0.002506831 0.002507821 0.002505357 0.002505301 0.002507838 [25] 0.002507646 0.002502572 0.002504063 0.002505777 0.002506869 0.002502164 ...
  • 66. You can select multiple rows and columns using vectors. > SOC[1:5, c("SOC","tsme")] SOC tsme 1 12.000325 0.003985153 2 3.483653 0.002502976 3 2.313414 0.002504971 4 1.941427 0.002508691 5 1.342969 0.002509177
  • 67. Of course you can write values into a data.frame. We make a copy of SOC (so we don't mess up the original) > SOCtemp <- SOC > SOCtemp[3,"tsme"] [1] 0.002504971 > SOCtemp[3,"tsme"] <- 1 > SOCtemp[3,"tsme"] [1] 1
  • 68. Recycling rules apply if less values are supplied than selected > SOCtemp[1:5,"tsme"] <- 1 > SOCtemp[1:5,] Id UpperDepth LowerDepth SOC Lambda tsme 1 4 0 30 12.000325 0.01 1 2 7 0 30 3.483653 0.01 1 3 8 0 30 2.313414 0.01 1 4 9 0 30 1.941427 0.01 1 5 10 0 30 1.342969 0.01 1
  • 69. For example, look at the ‘SOC’column. Which of these is higher than 2? > SOC$SOC > 2 [1] TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [13] TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE [25] TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [37] FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE [49] FALSE TRUE TRUE FALSE FALSE TRUE TRUE FALSE TRUE FALSE TRUE TRUE [61] TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE FALSE ...
  • 70. We can now use this variable to access only the rows that have SOC > 2 > SOCHigh <- SOC$SOC > 2 > SOC[SOCHigh,] Id UpperDepth LowerDepth SOC Lambda tsme 1 4 0 30 12.000325 0.01 0.003985153 2 7 0 30 3.483653 0.01 0.002502976 3 8 0 30 2.313414 0.01 0.002504971 6 11 0 30 2.287933 0.01 0.002509360 7 12 0 30 2.715843 0.01 0.002518323 ...
  • 71. Or do it all at once (in pure R fashion) > SOC[SOC$SOC > 2,] Id UpperDepth LowerDepth SOC Lambda tsme 1 4 0 30 12.000325 0.01 0.003985153 2 7 0 30 3.483653 0.01 0.002502976 3 8 0 30 2.313414 0.01 0.002504971 6 11 0 30 2.287933 0.01 0.002509360 7 12 0 30 2.715843 0.01 0.002518323 8 13 0 30 4.340112 0.01 0.002515760 ...
  • 72. Ordering You can reorder the data.frame by one or more columns using the order() function > SOC[order(SOC$tsme),] Id UpperDepth LowerDepth SOC Lambda tsme 2268 4039 0 30 0.00000000 0.01 0.002472194 145 396 0 30 1.17823531 0.01 0.002479430 1527 2803 0 30 0.45000000 0.01 0.002482055 471 1032 0 30 0.62766244 0.01 0.002482168 1581 3101 0 30 0.92922471 0.01 0.002484241 2237 3996 0 30 1.44240409 0.01 0.002484922 2629 5048 0 30 0.85421359 0.01 0.002485544 1910 3590 0 30 1.45097492 0.01 0.002486062 1650 3234 0 30 0.00000000 0.01 0.002486621 2536 4632 0 30 1.76030792 0.01 0.002486932 ...
  • 73. Ordering You can reorder the data.frame by one or more columns using the order() function > SOC[order(SOC$tsme, SOC$SOC),] Id UpperDepth LowerDepth SOC Lambda tsme 2268 4039 0 30 0.00000000 0.01 0.002472194 145 396 0 30 1.17823531 0.01 0.002479430 1527 2803 0 30 0.45000000 0.01 0.002482055 471 1032 0 30 0.62766244 0.01 0.002482168 1581 3101 0 30 0.92922471 0.01 0.002484241 2237 3996 0 30 1.44240409 0.01 0.002484922 2629 5048 0 30 0.85421359 0.01 0.002485544
  • 74. Making your own data.frame is straightforward using the data.frame() function. For example: > year <- 2000:2010 > catch <- c(900, 1230, 1400, 930, 670, 1000, 960, 840, 900, 500,400) > dat <- data.frame(year=year, catch=catch) > head(dat) year catch 1 2000 900 2 2001 1230 3 2002 1400 4 2003 930 5 2004 670 6 2005 1000
  • 75. It's possible to add extra columns of various types > dat$area <- c("N","S","N","S","N","S","N","S","N","S","N") > dat$survey <- c(TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE) > head(dat) year catch area survey 1 2000 900 N TRUE 2 2001 1230 S FALSE 3 2002 1400 N FALSE 4 2003 930 S TRUE 5 2004 670 N TRUE 6 2005 1000 S TRUE
  • 76. To add an extra row or rows use rbind and pass in a data.frame with the exact same column names and types > dat2 <- data.frame(year = 1920, catch = 666, area = "N", survey = FALSE) > dat <- rbind(dat, dat2) > dat year catch area survey 1 2000 900 N TRUE 2 2001 1230 S FALSE 3 2002 1400 N FALSE 4 2003 930 S TRUE 5 2004 670 N TRUE 6 2005 1000 S TRUE 7 2006 960 N TRUE 8 2007 840 S TRUE 9 2008 900 N FALSE 10 2009 500 S TRUE 11 2010 400 N TRUE 12 1920 666 N FALSE
  • 77. Ask at least 4 people near you and make a data.frame to hold the following information about them: Name, hair colour, height, shoe size, how long they can hold their breath for. • Reorder the data.frame by height. • Subset the data.frame to only include people taller than 1m 70. • What is the mean shoe size of the people in the data.frame? • Whose shoe size is closest to the mean shoe size?
  • 78. We need to talk about factors. Macedonian Soil Data data.frame > head(MSoil) Id UpperDepth LowerDepth SOC Lambda tsme Region 1 4 0 30 12.000325 0.01 0.003985153 A 2 7 0 30 3.483653 0.01 0.002502976 B 3 8 0 30 2.313414 0.01 0.002504971 B 4 9 0 30 1.941427 0.01 0.002508691 B 5 10 0 30 1.342969 0.01 0.002509177 B 6 11 0 30 2.287933 0.01 0.002509360 B
  • 79. We need to talk about factors. In the Macedonian Soil Data data.frame Take a look at the ‘Region’ column > head(MSoil$Region) [1] A B B B B B Levels: A B They look like characters, but no quotes. There are two “levels”: A and B. What does this mean?
  • 80. They look like characters, but no quotes. There are two “levels”: A and B. What does this mean? > class(MSoil$Region) [1] "factor"
  • 81. Factors Factors are a way of encoding data that can be used for grouping variables. Values can only be one of the defined 'levels'. This allows you to keep track of what the values could be. They can be used to ensure that a data set is coherent.
  • 82. For example, if we try to set a value in the “Region” column to something other than A or B, we get a warning > MSoil[1,"Region"] <- "20" Warning message: In `[<-.factor`(`*tmp*`, iseq, value = "20") : invalid factor level, NA generated
  • 83. And a broken data.frame > MSoil[1,] Id UpperDepth LowerDepth SOC Lambda tsme Region 1 4 0 30 12.00032 0.01 0.003985153 <NA>
  • 84. Let's fix it :) > MSoil[1,"Region"] <- "A" > MSoil[1,] Id UpperDepth LowerDepth SOC Lambda tsme Region 1 4 0 30 12.00032 0.01 0.003985153 A
  • 85. Factors If you really wanted to change the value to something not in the levels you need to change the levels too (the names of the factors) > levels(MSoil$Region) [1] "A" "B"
  • 86. Factors If you really wanted to change the value to something not in the levels you need to change the levels too (the names of the factors) > MSoil[1,"Region"] <- "C" > > head(MSoil) Id UpperDepth LowerDepth SOC Lambda tsme Region 1 4 0 30 12.000325 0.01 0.003985153 C 2 7 0 30 3.483653 0.01 0.002502976 B 3 8 0 30 2.313414 0.01 0.002504971 B 4 9 0 30 1.941427 0.01 0.002508691 B 5 10 0 30 1.342969 0.01 0.002509177 B 6 11 0 30 2.287933 0.01 0.002509360 B
  • 87. Factors If you really wanted to change the value to something not in the levels you need to change the levels too (the names of the factors) MSoil[, "Region"] [1] C B B B B B B B B B B B B B B B B B B B B B A A A A A A A A A A A A A A [37] A B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B A A ... [973] B B B B B B B B B B B B B B B B B B B B B B B B B B B B [ reached getOption("max.print") -- omitted 2262 entries ] Levels: A B C
  • 88. Factors Factors are used for many methods and functions in R, such as linear analysis.
  • 89. let's make another data set that only includes Region == B > MSoilB <- subset(MSoil, Region=="B") > > MSoilB$Region [1] B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B ... [937] B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B [973] B B B B B B B B B B B B B B B B B B B B B B B B B B B B [ reached getOption("max.print") -- omitted 1147 entries ] Levels: A B C
  • 90. You can see that we have no observations for A but you know that there could be. This might be important for data management. When you import data into R, some of your columns may be read in as factors even if you did not intend them to.
  • 91. The by() function can be used to split the data and apply a function to each chunk. This can be very useful for summarising the data. For example, to split the data by the 'Region' column (into A and B chunks) and take the mean of the column of each chunk you can do > by(MSoil$SOC, MSoil$Region, mean) MSoil$Region: A [1] NaN ---------------------------------------------------------- MSoil$Region: B [1] 1.839508 ---------------------------------------------------------- MSoil$Region: C [1] 12.00032
  • 92. aggregate() does something similar but can be used to operate on multiple columns in a data frame.Learning how to manipulate data frames is a very useful skill.The plyr and reshape packages are worth your time getting to know.
  • 93. What is the mean height by hair colour of the people in your data.frame?
  • 94. A list is a very flexible container. It's like a vector, but the elements can be objects of any class and size - even lists (lists f lists of lists of …). This makes them very handy for moving big chunks of data around (particularly returning output from a function).
  • 95. Here we make two objects to put into a list. > best_food <- c("cake", "banana") > odd_numbers <- c(1,3,5,7,9) > notes <- "Something interesting"
  • 96. To make the list, we use the list() function. When you create a list, you should give the elements names (they don't have to be the name of the object). > my_list <- list(food = best_food, numbers = odd_numbers, note = notes) > class(my_list) [1] "list"
  • 97. Getting the length of the list and the names of the elements is straightforward > length(my_list) [1] 3
  • 98. Getting the length of the list and the names of the elements is straightforward > length(my_list) [1] 3 > names(my_list) [1] "food" "numbers" "note
  • 99. Elements in a list can be extracted using two methods. By name, using $ and the element name. > my_list$food [1] "cake" "banana"
  • 100. Accessing data in a list Using [[ and the element position or name. > my_list[[1]] [1] "cake" "banana" > > my_list[["food"]] [1] "cake" "banana"
  • 101. Modifying lists Lists can be easily extended - just add an extra element. > my_list[["new"]] <- c(1,3,5,7) > summary(my_list) Length Class Mode food 2 -none- character numbers 5 -none- numeric note 1 -none- character new 4 -none- numeric
  • 102. Processing lists lapply - apply the same function to each element in a list. > vec1 <- seq(from=1, to = 10, length = 7) > vec2 <- seq(from=12, to = 20, length = 6) > lst <- list(vec1 = vec1, vec2 = vec2) > lapply(lst, sum) $vec1 [1] 38.5 $vec2 [1] 96
  • 103. Processing lists This only makes sense if the same function can be applied to all elements. For example, if we add a character vector to the list, we can't use sum.But length makes sense. > lapply(lst, length) $vec1 [1] 7 $vec2 [1] 6 $str1 [1] 3
  • 104.
  • 105.
  • 106.
  • 107. # Exercise 4 Newlist <- list(a=1:10, b="Good morning", c="Hi") Newlist$a <- Newlist$a + 1 Newlist ## $a ## [1] 2 3 4 5 6 7 8 9 10 11 ## ## $b ## [1] "Good morning" ## ## $c ## [1] "Hi"