RE: [R] Writing data frames

About this list Date view Thread view Subject view Author view Attachment view

From: Andy Bunn (abunn@montana.edu)
Date: Tue 30 Dec 2003 - 11:44:27 EST


Message-id: <000101c3ce6e$262f3be0$78f05a99@msu.montana.edu>

The key is in the error message:
"...can't coerce array into a data.frame"

Even if as.data.frame.default is unhappy you can coerce m into a
data.frame.

write.table(data.frame(m1 = m[1], m2 = m[2]), file="C:\\R\\tst.txt",
col.names=T, row.names=F, quote=F, append = FALSE)

There's probably a nicer way to do the coercion but this works.

HTH, Andy

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Thu 01 Jan 2004 - 09:21:04 EST