Dear all What is the preferred spreadsheet-like x-delimited data format for use with R? Should I prefer tab-, comma-, space- or some_other_delimitor-seprated data? I'm asking this because I've been once bitten by CSV data containing ` ' ' (apostrophe) symbols that R couldn't easily digest. Probably no the best approach, I've eventually inspected the document and removed the apostrophes manually. But I'd rather avoid such issues in the future. Regards Liviu -- Do you know how to read? http://www.alienetworks.com/srtest.cfm http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
On Wed, Oct 20, 2010 at 11:25 AM, Liviu Andronic <landronimirc at gmail.com> wrote:> Dear all > What is the preferred spreadsheet-like x-delimited data format for use > with R? Should I prefer tab-, comma-, space- or > some_other_delimitor-seprated data? > > I'm asking this because I've been once bitten by CSV data containing ` > ' ' (apostrophe) symbols that R couldn't easily digest. Probably no > the best approach, I've eventually inspected the document and removed > the apostrophes manually. But I'd rather avoid such issues in the > future. >This is a FAQ. http://cran.r-project.org/doc/manuals/R-data.html#Data-Interchange-Format-_0028DIF_0029 -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
On Wed, Oct 20, 2010 at 5:30 PM, Nutter, Benjamin <NutterB at ccf.org> wrote:> I run into that problem frequently. I can usually circumvent it by using > the > ?quote = "\"" > Argument. ?The default is quote = "\"'" ?which uses the double and > single quote as quoting symbols. ?If you change it to "\"" it will read > the single quotes like regular text. >This solves my problem. It seems that the apostrophe issue affects comma- (CSV) as well as tab-delimited data files, so it would probably be wise to start using quote = "\"" whenever I suspect the presence of apostrophes. Regards Liviu