Hi All, I always have a problem with write.csv when I want the column names to be ignored, when I specify col.names=F, I get a header of V1 V2 V3 V4 etc. for example I tried write.csv(mydata, file="data.csv", quote=FALSE, row.names=F, col.names=F) Warning message: In write.csv(mydata, file = "data.csv", quote = FALSE, : attempt to set 'col.names' ignored>how can I get rid of this problem ? I do not want the header of V1 V2 V3... to appear in my output file, Thanks -- View this message in context: http://n4.nabble.com/write-csv-and-col-names-F-tp974477p974477.html Sent from the R help mailing list archive at Nabble.com.
?write.table On Thu, Dec 17, 2009 at 6:52 PM, kayj <kjaja27@yahoo.com> wrote:> > Hi All, > > I always have a problem with write.csv when I want the column names to be > ignored, when I specify col.names=F, I get a header of V1 V2 V3 V4 etc. > > for example I tried > > write.csv(mydata, file="data.csv", quote=FALSE, row.names=F, col.names=F) > Warning message: > In write.csv(mydata, file = "data.csv", quote = FALSE, : > attempt to set 'col.names' ignored > > > > how can I get rid of this problem ? I do not want the header of V1 V2 V3... > to appear in my output file, > > Thanks > -- > View this message in context: > http://n4.nabble.com/write-csv-and-col-names-F-tp974477p974477.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Use write.table instead. On Thu, Dec 17, 2009 at 6:52 PM, kayj <kjaja27 at yahoo.com> wrote:> > Hi All, > > I always have a problem with write.csv when I want the column names to be > ignored, when I specify col.names=F, I get a header of V1 V2 V3 V4 etc. > > for example I tried > > write.csv(mydata, file="data.csv", quote=FALSE, row.names=F, col.names=F) > Warning message: > In write.csv(mydata, file = "data.csv", quote = FALSE, ?: > ?attempt to set 'col.names' ignored >> > > how can I get rid of this problem ? I do not want the header of V1 V2 V3... > to appear in my output file, > > Thanks > -- > View this message in context: http://n4.nabble.com/write-csv-and-col-names-F-tp974477p974477.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 Fri, Dec 18, 2009 at 7:52 AM, kayj <kjaja27 at yahoo.com> wrote:> > Hi All, > > I always have a problem with write.csv when I want the column names to be > ignored, when I specify col.names=F, I get a header of V1 V2 V3 V4 etc. >I tried that and found the same problem, however, I found write.table(mydata, file="data.csv",col.names=F) works. write.csv calls write.table to save data, is there something wrong with it? -- Best Regards, Reeyarn T. Lee