[R] Newbie query - reading data into R - good news!

Andy Elvey andyelv at ibm.net
Wed Jan 27 07:34:59 CET 1999


> 
> --
>    O__  ---- Peter Dalgaard             Blegdamsvej 3
>   c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
>  (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907

 Yes - good news here. I think I must have put an extra "tab" or some
such 
 thing in my text file. I re-edited it (carefully putting in only one
tab 
 after the first column). I then entered the command as follows - 

> b <- read.table("C:\\RDoc\\data1.txt",header=T)
> b
  City         Number
1 Napier       2341  
2 Hastings     3425  
3 Otara        7694  
4 Wellington    458  
5 Christchurch 2015  
6 Dunedin      3021  
7 Nelson        879  
> class(b)
[1] "data.frame"
> mode(b)
[1] "list" 

 Success!  

 ( I think I may have also been thrown by using the mode() function
(which shows "list")
 rather than the class() function which shows data-frame.  )

  Very many thanks to all who have helped me here.  Good to be part of a
community 
 using such a wonderful package ....  :-)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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