[Rd] write.table

detlef.steuer@unibw-hamburg.de detlef.steuer@unibw-hamburg.de
Wed, 06 Dec 2000 10:55:52 +0100 (CET)


Hi Thorsten!

On 06-Dec-00 Torsten Hothorn wrote:
> 
> Good morning, 
> 
> suppose the following:
> 
> m <- round(matrix(rnorm(16), ncol=4), 3)
> a <- rev(c(0.01, 0.025, 0.05, 0.1))
> rownames(m) <- a
> colnames(m) <- c("0.25,0.75", "0.4,0.6", "0.1,0.9", "0.4,0.9")
> m
>       0.25,0.75 0.4,0.6 0.1,0.9 0.4,0.9
> 0.1       1.034  -0.119  -1.213   0.619
> 0.05      0.035   1.074   0.525   1.671
> 0.025    -1.687   0.960   0.324  -0.170
> 0.01      0.906   1.642   0.557  -2.224
> 
> and now write.table says:
> 
> write.table(m)
> "X0.25.0.75" "X0.4.0.6" "X0.1.0.9" "X0.4.0.9"

You can see write.table is the "bad guy" here, already giving incorrect
colnames. If you use write.table(as.data.frame(m)) everything is working fine.

cu
Detlef

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._