[R-sig-eco] Can Gravy's HOF Ignore NAs?

Michele Tobias tobias.michele at gmail.com
Fri Mar 4 23:40:44 CET 2011


Hello,
I'm building species response curves for several species (one curve for 
each species) using the percent cover measured at twenty points at 
increasing distance from a trail's edge (each successive point is 5 
meters from the last).  This data was collected at several locations, 
and each location did not have all of the species present.  Because of 
this, my dataframe has NA values when a species did not occur at a 
particular site.  I can change the NAs to zeros, but zero has a 
different meaning from NA.  Is there a way to have the HOF function in 
the gravy package ignore the NAs?  I tried running the data with the NAs 
left alone, and I get an error message.  The function works after I 
change the NAs to zeros but the extra zeros that were NAs seem to be 
affecting the output.  I've typed out an example similar to the table 
I'm working with below, in case that helps:

Example table:
Location            Species 1        Species 2        Species 3
Site 1 Point 1       10                    5                     15
Site 1 Point 2       15                   10                    0
Site 2 Point 1       5                      20                   NA
Site 2 Point 2       20                   10                   NA

I tried looking at the source code for the HOF function to answer my own 
question, but I'm not familiar with the language it was written in.

Thank you in advance for your help!  I'm very happy with the results 
I've gotten so far and I'm looking forward to refining what I have.

best,
Michele

-- 
Michele Tobias

PhD Candidate
Geography Graduate Group
University of California, Davis

mmtobias at ucdavis.edu
http://ggg.ucdavis.edu/student/michele-m-tobias
http://ucdavis.academia.edu/MicheleTobias

"The purpose of R-sig-ecology is two fold.
First, we want to provide a discussion forum for those analyzing ecological and environmental data with R.
Second, we want to encourage R users of all ability and experience to participate so that we may grow the
community of ecologists and environmental scientists that use R." https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list