[R] data.frame error message

Liaw, Andy andy_liaw at merck.com
Wed Feb 23 03:47:10 CET 2005


Following the suggestions in the Posting Guide would help us to help you
much better.

What command(s) did you use to get the data into R?  What does the `.dat'
file look like?  What are `x' and `y'?

Data frames in R, by definition, has to have (unique) rownames.  If they are
not present in the data source (e.g., a file), they will be created for the
data frame, and defaults to 1 through n where n is the number of rows.

Andy

> From: Nic Ellis
> 
> Dear R users,
> 
> I am using v2.0.1 on Windows 2000.  I have read a ".dat" file 
> with several 
> vectors, including 2 factors (2 levels x 3 levels), and a vector of 
> responses, into R. There are no unique row names.  When I try 
> plot(x,y) or 
> lm(y~x) the following error is returned:
> 
> Error in model.frame(formula, rownames,...extranames: 
> variable lengths differ
> 
> What am I doing wrong?  I am a new R user, and I didn't 
> figure it out from 
> the sections on data.frames in Dalgaard, Venable/Ripley, or 
> simpleR, or the 
> help threads.
> 
> Thanks-
> 
> Nic Ellis
> Penn State
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list