Hi all! I'm trying to save an output of the HEXBIN process... is so much data (105k), and I need to export to an ASCII file. I tried to use: write.table() ----> Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class 'structure("hexbin", package = "hexbin")' into a data.frame cat() ---> Error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'S4') cannot be handled by 'cat' write() ...but they didn't work :/ Please, somebody can help me? THANKS! Fco -- View this message in context: http://r.789695.n4.nabble.com/How-to-export-hexbin-tables-tp4496035p4496035.html Sent from the R help mailing list archive at Nabble.com.
What do you need to use it again for? If you just want to get it back for a different R session (which I think is the only thing that makes sense) you might only need to save() the object and then you can load() it later. [Or perhaps better, saveRDS() and readRDS()] Michael On Thu, Mar 22, 2012 at 12:31 PM, fco.pch <francisco at dfte.ufrn.br> wrote:> Hi all! > I'm trying to save an output of the HEXBIN process... is so much data > (105k), and I need to export to an ASCII file. > I tried to use: > ?write.table() ----> Error in as.data.frame.default(x[[i]], optional = TRUE) > : > ?cannot coerce class 'structure("hexbin", package = "hexbin")' into a > data.frame > > ?cat() ---> Error in cat(list(...), file, sep, fill, labels, append) : > ?argument 1 (type 'S4') cannot be handled by 'cat' > > ?write() > > ...but they didn't work ?:/ > Please, somebody can help me? > > THANKS! Fco > > -- > View this message in context: http://r.789695.n4.nabble.com/How-to-export-hexbin-tables-tp4496035p4496035.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
On Mar 22, 2012, at 12:31 PM, fco.pch wrote:> Hi all! > I'm trying to save an output of the HEXBIN process... is so much data > (105k), and I need to export to an ASCII file.?dump> I tried to use: > write.table() ----> Error in as.data.frame.default(x[[i]], optional > = TRUE) > : > cannot coerce class 'structure("hexbin", package = "hexbin")' into a > data.frame > > cat() ---> Error in cat(list(...), file, sep, fill, labels, append) : > argument 1 (type 'S4') cannot be handled by 'cat' > > write() > > ...but they didn't work :/ > Please, somebody can help me? > > THANKS! Fco >David Winsemius, MD West Hartford, CT
Michael... It WORKS!!! Finally, the most elegant way was yours: /aux.table <- sapply(.........) write.table(aux.table, file="hexbin.table.ascii", sep="\t")/ Thanks! hope be useful to R-users! -- View this message in context: http://r.789695.n4.nabble.com/How-to-export-hexbin-tables-tp4496035p4499568.html Sent from the R help mailing list archive at Nabble.com.