Hi, I know we can use 1:10 to represent the 1,2,3,...,10 numbers, but the following conditions are except. Anybody knows how to represent the following two cases with similar usage of ":" or others? Usually, i will get several hundred names for them, such as a1,a2,... or f[[1]],f[[2]],... #Example data a1<-array(1:12,c(2,3,2)); a2<-array(2,c(2,3,2)); a3<-array(0,c(2,3,2)) a1[1,2,1]:a3[1,2,1] [1] 3 2 1 0 #the correct result should be 3,2,0 So the method of using "a1[i,j,k]:a3[i,j,k]" to represent "c(a1[i,j,k],a2[i,j,k],a3[i,j,k])" is not correct? ##For lists with matrices as its elements f<-list() f[[1]]<-a1;f[[2]]<-a2;f[[3]]<-a3 f[[1]][1,2,1]:f[[3]][1,2,1] [1] 3 2 1 0 #the correct result should be 3,2,0 So the method of using "f[[1]][i,j,k]:f[[3]][i,j,k]" to represent "f[[1]][i,j,k],f[[2]][i,j,k],f[[3]][i,j,k])" is not correct? I noticed that the above two methods have got the same results, although not correct. So i guess i have made the same errors in them. Is there some method to represent them concisely? Any ideas about them? Thanks a lot.
-- ----------------- Jane Chang Queen's [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.