No subject
Dear friends. This is again a very simple question, and I hope you will accept it. I have a dataset with variables in columns all with their names. Now I want to add a column indicating simply identity of patients, numbered according to row. There are 34 rows. So I did:
ID <- c(1:34)
but was not allowed to
Ptt <- cbind(patients,ID)
and was informed that
Error: names attribute must be the same length as the vector
So, I removed the names
newname <- names(patients) names(patients) <- NULL ptt <- cbind(patients,ID)
but still got Error: names attribute must be the same length as the vector in spite of
names(ID)
NULL
names(patients)
NULL
attr(patients,"names")
NULL
attr(ID,"names")
NULL One thing, is that inconsistent ? Short of editing my data file, which would not be very difficult in this case, how could I do it ? Sincerely yours Troels Ring, MD -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._