Assigning values
- x
Creating Vectors
- x = c(“?”, “?”)
Sequencing
- seq(from=x, to=y, by=?)
Repeating
- rep(“?”, times=?)
Extracting from a vector
E.g. if: y = c(1, 3, 5, 7, 9) then: y[3] would extract the third number = 5 if: y = c(1, 3, 5, 7, 9) then y[-3] would extract everything but the third number = 1 3 7 9
Constructing a matrix
matrix(c(?,?,?,?,?,?), nrow=?, byrow=TRUE/FALSE)
Extracting from a matrix
?