Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. ""cat" )

2010-09-12 Thread Dennis Murphy
Hi: Thanks to Jakson Aquino, who showed me how to do a proper text substitution, we have a way out. It also turns out that in the last line, the last numeric field was missing, so I inserted an NA| in the last line of the data file before calling readLines(). His (correct) code is at the bottom of

Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. ""cat" )

2010-09-12 Thread Wil M Contreras Arbaje
True, I'd actually misread the problem as being "' and not "". In the interest of expediency, here's one solution I can think off the top of my head: using MS-Word (dunno if it's taboo in these lists, but it's what I have at hand at the moment–I believe in using all the tools available, if i

Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. ""cat" )

2010-09-12 Thread Dennis Murphy
Hi: On Sun, Sep 12, 2010 at 1:05 PM, Wil M Contreras Arbaje < wil.contre...@gmail.com> wrote: > While you are looking for a solution within R, it might be simpler to open > your text file in almost any free text editor (Notepad++, Textwrangler, > Smultron, vim come to mind), and do Replace all "'

Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. ""cat" )

2010-09-12 Thread Wil M Contreras Arbaje
While you are looking for a solution within R, it might be simpler to open your text file in almost any free text editor (Notepad++, Textwrangler, Smultron, vim come to mind), and do Replace all "' for ". On Sep 12, 2010, at 3:58 PM, jim holtman wrote: You can use the 'gsub' command to remo

Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. ""cat" )

2010-09-12 Thread jim holtman
You can use the 'gsub' command to remove the quote marks. You could readLines/writeLines the file to clean it up with gsub before using read.table on it so it can all be done within R. On Sun, Sep 12, 2010 at 1:58 PM, Eva Nordstrom wrote: > I am using read.table to import a text file within R. >

[R] using read.table, removing extra quotation mark from a text field? (e.g. ""cat" )

2010-09-12 Thread Eva Nordstrom
I am using read.table to import a text file within R.   There are several "errors" in my text file.  An "extra" quotation mark has inadvertently been included within a few text fields.   e.g. for a pipe (|) delimited text file, I have something similar to this:   1|7|30| "dog" 2|6|25| ""cat" 3|4