[R] Reading # in file with read.csv

From: Michel Friesenhahn <michel.friesenhahn.b_at_bayer.com>
Date: Wed 12 Oct 2005 - 04:40:43 EST

Never mind on my previous question below. read.csv("Raw Data\\test.csv",comment.char="") does it.

Mike

I'm using read.csv to read in a csv file containing '#' characters. For example, say I'm reading the following file (test.csv):

var1,var2,var3

a,b,c
d,e#,f
g,h,i

It outputs:

> read.csv("Raw Data\\test.csv")
  var1 var2 var3
1 a b c
2 d e
3 g h i
Warning message:
incomplete final line found by readTableHeader on 'Raw Data\test.csv'

read.csv appears to be treating '#' as a comment even in input data. Is there a way to turn this interpretation off?

Thanks,

Mike



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Oct 12 05:02:23 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:41:10 EST