Re: [R] Problem with writing a CSV file in UTF-8 formate

From: Shotwell, Matthew S <shotwelm_at_musc.edu>
Date: Tue, 22 Jun 2010 09:23:16 -0400

This should do it:

out <- file("preindx.csv", "w", encoding="UTF-8") write.table(dfPREINDX, out, sep="|", row.names=FALSE) close(out)

However, I believe that using "|" as a field separator makes this NOT a comma separated values (CSV) file, rather a "|" separated values file.

-Matt



From: r-help-bounces_at_r-project.org [r-help-bounces_at_r-project.org] On Behalf Of venkata kirankumar [kiran4u2all_at_gmail.com] Sent: Tuesday, June 22, 2010 9:00 AM
To: r-help_at_r-project.org
Subject: [R] Problem with writing a CSV file in UTF-8 formate

Hi all,
I have a problem with writing a *.CSV file in UTF-8 formate

I tried to write a dataframe named "dfPREINDX" to the new file named "preindx.csv" in below formate

write.table(dfPREINDX,PreIndex,fileEncoding="UTF-8",sep="|",row.names=FALSE)

but its throed an error like

Error in write.table(dfPREINDX, "preindx.csv", fileEncoding = "UTF-8", sep = "|", :
  unused argument(s) (fileEncoding = "UTF-8")

can any one please help me how to create a file in UTF-8 formate.

Thanks in advance
kiran.

        [[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.

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 22 Jun 2010 - 13:26:52 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 22 Jun 2010 - 13:30:34 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