data(auto)
# "coerce"
auto <- as(auto,"triangles") # transform "list" to be "triangles"
# method for "["
auto[,4:6,drop=FALSE] # rows of all NA's not dropped
auto[,4:6] # drop rows of all NA's
auto[8:10, ,drop=FALSE] #columns of all NA's not dropped
auto[8:10, ] #columns of all NA's dropped
auto[1:2,1]
# replacement method
auto[1:2,1] <- list(1,2,3)
auto[1,2]
dim(auto)
cbind2(auto[1:2,1])
rbind2(auto[1:2,1])
Run the code above in your browser using DataLab