I'm trying to read in some data from a .csv format and have come across
the following issue. Here is a simple example for replication
# A sample .csv format
schid,sch_name
331-802-7081,School One
464-551-7357,School Two
388-517-7627,School Three \ Four
388-517-4394,School Five
Note the third
Dear Harold,
One thing you can do is to read the file plainly, even if the \ is
lost and then, inside R, change the string value with gsub.
Sincerely,
Carlos J. Gil Bellosta
http://www.datanalytics.com
http://www.data-mining-blog.com
El miƩ, 16-08-2006 a las 14:43 -0400, Doran, Harold
Try 'gsub'
y
schidsch_name
1 331-802-7081 School One
2 464-551-7357 School Two
3 388-517-7627 School Three Four
4 388-517-4394 School Five
levels(y$sch_name) - gsub(, , levels(y$sch_name))
y
schid sch_name
1
On Wed, 2006-08-16 at 14:43 -0400, Doran, Harold wrote:
I'm trying to read in some data from a .csv format and have come across
the following issue. Here is a simple example for replication
# A sample .csv format
schid,sch_name
331-802-7081,School One
464-551-7357,School Two
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 16, 2006 3:10 PM
To: Doran, Harold
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] read.csv issue
Try 'gsub'
y
schidsch_name
1 331-802-7081
Set allowEscapes = FALSE when reading. See the help page for more details.
There is perhaps an argument for changing the default for allowEscapes
under read.csv, especially as people have now changed that for
comment.char (in R-devel).
On Wed, 16 Aug 2006, Doran, Harold wrote:
I'm trying to
On Wed, 16 Aug 2006, Prof Brian Ripley wrote:
Set allowEscapes = FALSE when reading. See the help page for more details.
There is perhaps an argument for changing the default for allowEscapes
under read.csv, especially as people have now changed that for
comment.char (in R-devel).
Oops,
To: Doran, Harold
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] read.csv issue
On Wed, 16 Aug 2006, Prof Brian Ripley wrote:
Set allowEscapes = FALSE when reading. See the help page
for more details.
There is perhaps an argument for changing the default for
allowEscapes
under read.csv