Message-ID: <FBA88BE6-16B8-4B82-B96F-EF3E1F9FBF03@oulu.fi>
Date: 2012-04-24T13:01:16Z
From: Jari Oksanen
Subject: rarefaction not working with the min species number
In-Reply-To: <4F969EC4.9030602@auburn.edu>
On 24/04/2012, at 15:39 PM, Stephen Sefick wrote:
> I will provide reproducible code if I need to.
>
> All:
>
> I am trying to set up a 1000 pulls of a community data frame for calculating richness measures. I would like to be able to code the sample number based on the minimum of all of the samples. I can do this but there is an error:
>
> Error in sample(rep(nm, times = x[i, ]), sample[i]) :
> cannot take a sample larger than the population when 'replace = FALSE'
>
> when using:
>
> rrarefy(L, min(apply(L, 1, sum)))
>
> min is returning the lowest sample abundance of all of the samples. rrarefy works if I subtract 5 (arbitrary) from the min(...) statement. I am sure that I am missing something simple.
> many thanks,
>
Stephen,
I can reproduce this if input data ('L') contain non-integer data. The function is only able to handle integer data, but it does not check the input. Probably it should: the error would still be there, but the message would be more informative.
Cheers, Jari
--
Jari Oksanen, Dept Biology, Univ Oulu, 90014 Finland