Dr. Obrist--

What you ask is very much a pre-processing step that should before using
any of the functions in vegan.  In terms of workflow it is equivalent to
lumping sub-specific taxa to a consistent taxonomic level, or updating
taxonomic names and then pooling multiple records for the same taxon at the
same site/plot.  It is best performed on long-format data before
labdsv::matrify().

The limiting step is not the R code (a rather simple function combined with
plyr::ddply() handles it), but rather the ecology and the exact protocol
for your data collection/recording.  There is no general solution that is
correct for most or all cases, but rather dozens or hundreds of (simple)
functions, each of which is appropriate for a different specific set of
data.

The problem case is where you have all 3 recorded for a plot: C, D, CorD.
 If you are dealing with simple presence/absence, you are fine just
dropping CorD.  But if you are doing rarefaction, numbers of individuals
matter, and you don't know how to apportion the CorD individuals to C or to
D.  Depending on the precision & accuracy you need, and whether you can
assume that all individuals recorded as a single observation CorD in a plot
are the same (all C or else all D), you may need to simulate assorting all
1 way versus all the other, or some magic assortment of each individual
CorD being C with probability pCinCorD (binomial sample is simple, choosing
appropriate probabilities is non-obvious).  Even in the first case of all c
or all D, you would have 2^Nx simulated dataframes to run through
rarefaction, where Nx is the number of plot by taxon groupings where this
problem case occurs.  And, you'd have to decide how to summarize the range
of results from rarefaction on those runs (unweighted mean is probably not
a good idea).

If you are sure you never have the problem case of C and D and CorD, the
function that goes inside ddply() grabs the values of the SpeciesID
occurring in that plot, splits it into a vector of simple species codes and
a vector of uncertain species codes, then splits the uncertain codes into
components and replaces the uncertain codes with whichever component is
%in% the vector of simple codes for that plot.  I don't have this case in a
function as I've never had a dataset without the C + D + CorD case either
occurring or possible.

I hope that this is informative, even if it probably isn't 'helpful'.

Tom 2


On Tue, Nov 12, 2013 at 7:23 AM, Martin Obrist <martin.obrist@wsl.ch> wrote:

> Dear all
>
> we'd like to optimize rarefactions in a species group with imperfect
> identifications.
>
> To illustrate, let's say we have evidence for
>
> Species A
> Species B
> Species_aggregate C/D
>
> in a sample. Despite only having two species identified, and an additional
> species complex (where we are not sure if it is C or D) we actually can be
> sure to have three species detected.
>
> However, if we have a list
>
> Species A
> Species B
> Species_aggregate B/C
>
> we can only be certain of two species, as species B, already counted,
> could also be present in the complex of B and C.
>
> I'm aware, that I would need a matrix somewhere to check if n is contained
> in k, e.g.
>
> (column contains row)
>
>  \ n A  B  C  D
> k \
> A    1  0  0  0
> B    0  1  0  0
> C    0  0  1  0
> D    0  0  0  1
> CD   0  0  1  1
> BC   0  1  1  0
>
> We would like to use this improved counting in randomized sample
> extractions (e.g. in rarefy or specaccum in package vegan), thus search for
> a function that could be called.
>
> Does anybody know of such a functionality in any of the ecological
> packages? Vegan does not seem to be able to account for such mechanisms...
>
> Any tips are appreciated!
>
> Regards
>
> Martin
>
>
>       Dr. Martin K. Obrist                    ^v^
>                                                                      ^v^
>    Swiss Federal Research Institute WSL
>    Biodiversity and Conservation Biology
>    CH-8903 Birmensdorf, Switzerland
>    MG D 52        phone: ++41 44 739 24 66        fax: ++41 44 739 22 15
>    E- mailto:martin.obrist@wsl.ch   WWW
> http://www.wsl.ch/fe/biodiversitaet/
>
>
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



-- 
-------------------------------------------
Tom Philippi, Ph.D.
Quantitative Ecologist & Data Therapist
Inventory and Monitoring Program
National Park Service
Tom_Philippi@nps.gov
http://science.nature.nps.gov/im/monitor

	[[alternative HTML version deleted]]

