Re: [R] Export csv data

From: Hans-Peter <>
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.


        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide 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 Please read the posting guide before posting to the list.

list of date sections of archive