Skip to content
Prev 1937 / 398506 Next

Newbie query - reading data into R

Try sep="\t", if they are really separated by tabs (they were not in
your email by the time it reached here).  Actually, you don't need
as.if=F, either, as the first column should be the row names:
Number
Napier          324
Auckland        657
Wellington      879
Christchurch    904

works on your example (with tabs in the file).

(S-PLUS behaves differently here, and guesses the first column
should be the row names without being told).  

I don't know how you got a list -- that may depend on the version of
R you used, so please tell us when you post. (On 0.63.2 I tried
a few ideas, but failed.  It may be that you do in fact have
a data frame, but a malformed one so that it prints like a list.)
Beware, R is `not unlike S' but it is also different from S-PLUS,
in ways that change by the R version.