[R-sig-eco] Can Gravy's HOF Ignore NAs?
Jari Oksanen
jari.oksanen at oulu.fi
Sat Mar 5 06:55:01 CET 2011
Michele,
The HOF functions of the (unreleased) gravy package cannot handle NA.
NAs indeed have different meaning than zeros. In case, you *should* have
zeros instead of NA. If you have recorded a species as missing, then it is
zero. NA means that you do not know if species is missing: it may occur on
your site or then not (begins to sound as a tricky as trying to say "is you
is or is you ain't my species").
Cheers, Jari Oksanen
On 5/03/11 00:40 AM, "Michele Tobias" <tobias.michele at gmail.com> wrote:
> 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
More information about the R-sig-ecology
mailing list