1 Dec 03:20
a question of Data quotation
Dear the friends of R-Ecology:
I am a beginner for R language, therefore I am sure that this question is possibly quite simple, but it still
mean a big problem to me.
I select two columns of 'npp' to combine a new variable:data, and give its colnames as jan and feb, the code is following:
data<-cbind(npp$JAN,npp$FEB)
colnames(data)<-c("jan","feb")
I found that the columns of 'data',could not quoted as 'data$jan',or'data$feb',but can quoted well as
data[,1] or data[,2].
Tips of R-software is 'data$jan : $ operator is invalid for atomic vectors'
I try to use the function 'as.matrix' convert the data to numeric type,but get the just same result. I am
confused about this problem.
Any help is strongly appreciated,
thank you in advance,
Zongshan, Li£¬zsli_st <at> rcees.ac.cn
2009-12-01
Research Center for Eco-Environmental Sciences,Chinese Academy of Sciences
Shuangqing Road, Haidian street, Beijing, 100085
Tel: 86-10-13699145748
QQ: 1141958023
email: zsli_st <at> rcees.ac.cn
website: http://www.rcees.ac.cn/
[[alternative HTML version deleted]]
(Continue reading)
RSS Feed