Re: [R-sig-eco] NA error in envfit

2013-12-06 Thread Jari Oksanen
Kendra, Are you sure that it was a factor? I am unable to trigger an error with a one-level factor in vegan 2.0-9. Moreover, the error message you sent was from vectorfit and factors (also one-level factors) are not handled in that function but they go to factorfit, and error should come from f

Re: [R-sig-eco] NA error in envfit

2013-12-06 Thread Mitchell, Kendra
My offending variable was correctly imported as a factor, but since I was subsetting the data to look only at one zone at a time it was a factor with only one level -- Kendra Maas Mitchell, Ph.D. Post Doctoral Research Fellow University of British Columbia 604-822-5646

Re: [R-sig-eco] NA error in envfit

2013-12-06 Thread Gavin Simpson
Phillip, You approach to using factors misses an important consideration; the class that was observed in the full dataset should not disappear just because you subsetted the data in some manner. Also, `droplevels()` is a useful function to call on a factor or data frame if subsetting produces leve

Re: [R-sig-eco] NA error in envfit

2013-12-06 Thread Jari Oksanen
On 05/12/2013, at 18:42 PM, Dixon, Philip M [STAT] wrote: > > I wonder if the problem is a factor level with no observations. One of the > frustrating things about factors (class variables) in R is that the list of > levels is stored separately from the data. This can cause all sorts of > pr