Hi guys, I need your help. I would like to select a subset from a dataset. This is the dimension of the dataset.
> dim(data1) [1] 72 36 1916 so, it's like.. there are 1916 of 72 * 36 matrix. ==> looks like 72 * ( 36*1916 ) ** *1)* And I would like to select the first 72*36 matrix. This is how I did: > two=data1[,1:36] Error in data1[, 1:36] : incorrect number of dimensions Do you have any idea how I should fix this? *2) *I thought about another way to deal with this problem. Firstly, I name the each column variable: >colnames(data1)=paste('lati',1:36) and then select: >one=subset(data1,subset=TRUE, select = lati1:lati36) but the problem is that, although I tried to select only 36 columns, above command selects the all columns. (36*1916 =68976) I think if I can name all the variables at one time, say , colnames(data1)=paste('lati',1:68976) ,then it wouldn't have been a problem. (but obviously, <---this command does not work) Do you have any idea how to deal with this?? *3)* After all, what I would really like to do is to transpose the data: The dataset I have above is 72*68976. (hard to export to csv; since max column# is 18000 something.) I have to transpose the data.. obviously. But, the problem is, after I transpose the data and export it to csv, I can't really see the data. Besides, I think tranpose thing does not seem work as I want, >bbb=t(as.matrix(data1)) >write.csv(bbb,"c:/oo.csv") Please help me, Thanks. -Hyo [[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.