[R] read.table, input methods

Pete St. Onge pete at seul.org
Tue Jan 4 05:10:07 CET 2000


> I'm trying to read data into R that was exported from Excel, as
> tab-delimited text.  There are some empty cells in the spreadsheet,
> which I'd like to treat as missing values.

> I could preprocess the text, say in perl, to insert missing value
> strings where needed; is this my only recourse?

     Suggest you do it before you export the spreadsheet ...

     If you still have the original spreadsheet, block out the active
area containing your data, and search and replace empty cells with a
character you can later specify as being NA. Caveat: make sure that the
'find whole cell' option is checked in the find and replace dialog - you
could otherwise overwrite all of your data...
     Doing it this way means less headache for you, requiring only the
line with the read.table statement - and no post-import manipulations
should be needed.

     Hope this helps,


Pete St. Onge
pete at seul.org
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list