When I read a table (the dimnames of the table are numbers), R reads the column names as: X plus the number (X1,X2,X3,...) and the rownames as the numbers (1,2,3,...) How can I suppress this action? The code and the output: ^^^^^^^^^^^^^^^^^^^^^^^^> r2<-read.table("h:\\matrix",header=T,dec=",",na.strings="-99") > dimnames(r2)[[1]] [1] "500" "1601" "1906" "2503" "3202" "4905" "5000" "5012" "5315" "5604" "5881" "5870" ................................ [81] "20220" "21300" "11900" "14310" "20901" "18900" "19000" [[2]] [1] "X500" "X1601" "X1906" "X2503" "X3202" "X4905" "X5000" "X5012" "X5315" "X5604" "X5881" ................................. [85] "X20901" "X18900" "X19000" Thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Pesl Thomas <thomas.pesl at arcs.ac.at> writes:> When I read a table (the dimnames of the table are numbers), R reads the > column names as: X plus the number (X1,X2,X3,...) and the rownames as the > numbers (1,2,3,...) > How can I suppress this action?check.names=FALSE -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Pesl Thomas wrote:> > r2<-read.table("h:\\matrix",header=T,dec=",",na.strings="-99") > > dimnames(r2)Why use the "header=T" argument if the first row of the file "matrix" seems to contain numbers, and not the names for the variables? Moreover, note that "read.table" has additional arguments like "row.names": a vector of row names and "col.names": a vector of optional names for the variables Greets Diego -- Diego Kuonen http://wap.kuonen.com http://stat.kuonen.com http://www.Statoo.ch Kya aap statooed hai? http://www.Statoo.com -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._