Dear R Gurus,

Let's get the technical details out of the way first:

Computer: 1.83 GHz MacBook
R version 2.5.1

I have a data set that contains the following variables: site,  
species, total.vines.  I need to partition the main data set by site,  
the further select only those species that occurred at each site.   
When I select by site (site.name<-subset(data frame,Site=="Site  
name"), the resulting data frame is normal, containing all the  
records for that particular site.

When I then further select by species, (site.name1<-subset(site.name,  
Species=c("species 1", "species 2", "species 4", "species 7",  
"species 8"))), I get an error message:

> Warning messages:
> 1: longer object length
>       is not a multiple of shorter object length in: is.na(e1) | is.na(e2)
> 2: longer object length
>       is not a multiple of shorter object length in: `==.default` 
> (Species, c("ACNE", "ACSA2", "JUNI", "PLOC", "ULAM"))

If I then only select for two species instead of five, the error  
messages disappear HOWEVER, the data will be cut in half, so the new  
data frame only contains 13 records of species 1 (instead of 26 as in  
the original) and 12 records of species 2 (instead of the original  
24).  This is the first time I'm experiencing this problem, as I have  
used subset on this data several times in the past month.  Any ideas  
on where I'm going wrong?

Thanks for your help.

Jim Milks

Graduate Student
Environmental Sciences Ph.D. Program
136 Biological Sciences
Wright State University
3640 Colonel Glenn Hwy
Dayton, OH 45435
http://www.wright.edu/academics/envsci/



        [[alternative HTML version deleted]]

______________________________________________
R-help@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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to