Here, we will have a first look at the creation of
list objects, which can contain in them objects of different classes:
A <- LETTERS[1:6]. Create an integer vector of the first ten integers 1-10 with
B <- 1:10, and a matrix with
C <- matrix(1:6,nrow=2).
Z <- list(A = A, B = B, C = C).
Zand its three components in
Care indeed retained as follows:
class(Z); class(Z$A); class(Z$B); class(Z$C).
The consolidated R codes are given next, which you will have to enter at the R console:
A <- LETTERS[1:6]; B <- 1:10; ...