Why don't you just give it a try?
> train <- rbind(iris3[1:25,,1], iris3[1:25,,2], iris3[1:25,,3]) > test <- rbind(iris3[26:50,,1], iris3[26:50,,2], iris3[26:50,,3]) > train <- rbind(iris3[1:25,1], iris3[1:25,2], iris3[1:25,3]) Error in iris3[1:25, 1] : incorrect number of dimensions > test <- rbind(iris3[26:50,1], iris3[26:50,2], iris3[26:50,3]) Error in iris3[26:50, 1] : incorrect number of dimensions
More generally, leaving the index unspecified, selects all records for this index:
> mtx<-matrix(c(1,2,3,4),nrow=2) > mtx [,1] [,2] [1,] 1 3 [2,] 2 4 > mtx[1,] [1] 1 3 > mtx[,1] [1] 1 2