Re: [R] Export csv data

From: Hans-Peter <gchappi_at_gmail.com>
Date: Tue, 04 Mar 2008 11:38:03 +0100

>
> now i ended up with only 10000. The 10000 is fine but when i export to
> excel, it is missing the probeID. Here are my code and examples.
>
> library(xlsReadWrite)
> ...
> write.xls(cbind(data[1],
> Variance=apply(data[,y],1,var)),file='c://variance.csv')

If you use write.xls you will get a binary xls-file and shouldn't use ' variance.csv' as filename (which make people expect a comma-delimited plain text file. If you want this you can use one of the functions write.table, write.csv or write.csv2.

I was not able to run the code and don't know why ProbeID is missing. Personally I mostly calculate the data first and do output it afterwards, e.g.

  mydat <- cbind( data[1], Variance = apply( data[,y], 1, var ) )   write.xls( mydat, file = "c://variance.xls" )

Thus it is more clear if the problem is with the data or with the writing. If you provide me a small mydat dataset I could probably help better.

Best,
Hans-Peter

        [[alternative HTML version deleted]]



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. Received on Tue 04 Mar 2008 - 10:53:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 04 Mar 2008 - 11:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive