Re: R-beta: vectors in dataframe?

Peter Dalgaard BSA (p.dalgaard@biostat.ku.dk)
27 Apr 1998 23:47:10 +0200


To: Bill Simpson <wsimpson@uwinnipeg.ca>
Subject: Re: R-beta: vectors in dataframe?
From: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>
Date: 27 Apr 1998 23:47:10 +0200
In-Reply-To: Bill Simpson's message of Mon, 27 Apr 1998 16:19:48 -0500 (CDT)

Bill Simpson <wsimpson@uwinnipeg.ca> writes:

> > thingy<-read.table(file="rstuff/output.cif3")
> > thingy$tau1
> NULL
> > thingy[,"tau1"]
> Error: subscript out of bounds
> > attach(thingy)
> > tau1
> Error: Object "tau1" not found
>  but
> > thingy
> lists the row number, tau1, tau2, p3cond
> i.e. all the data as 4 cols of numbers (up to row 1601).

My students keep doing that too... 

If you look more closely, you'll see that what looks like column names
are really the first line of observations. You need to tell R that the
first line of the input file contains the column names

read.table(....., header=T)

should do it. And for a sanity check on your data frames, I suggest to
make a habit of

summary(thingy)

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

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._