[R] Importing with read.table

Balint, Jess JBalint at alldata.net
Wed Nov 13 18:32:44 CET 2002


Hi all. I have something similar to the following:

myinfo <- read.table( file = "myfile.txt", sep = "|", col.name = c( "data1",
"data2" ) )

myfile.txt:
a|1|
b|2|

However, since there are two pipe (|) characters, it reads it in and thinks
there should be three columns. This is not the case and I get a warning
about col.names is wrong length. Is there a way around this? Thanks.

jess
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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