Primary source: Art of R Programming, Matloff
Data Frames can be thought of as collections of vectors
? - What is the difference between a data frame and a matrix?
Key dataframe concepts
filtering
x = rep(8,6)
x # valuable license plate in Hong Kong
str(x)
u <- c(5, 2, 8)
v <- c(1, 3, 9)
u > v
w <- function (x) return (x + 1)
w(u)
# + operator is vectorized; really is a function!
'+'(2,3)
y <- c(1.2, 3.9, 0.2)
round(y)
u == v
identical(u, v)
When we discuss factors, we’ll look at ifelse() and tapply():