# R solutions for in-class tasks. MAS115 Sem 2, Lab Class 3
# 1.6 Tasks solutions
# 1. For example
A <- matrix(c(1,9,14,5,21,36),nrow=2,byrow=TRUE)
# 2.
A <- rbind(c(1,9,14),c(5,21,36))
# 3.
A[2,,drop=FALSE]
# 4. We could specify drop=TRUE, but no need
A[,3]
#5.
A[A>15] <- NA
# Not asked for, but you should understand how to break this into steps.
# On its own, what is given by A>15 ? A boolean matrix.
A>15
A[A>15]