Description Usage Arguments Details Examples
Fill missing binary trait data values based on taxonomic structure.
1 |
dat |
A data set (see Details) |
nrep |
Number of simulation runs to do. |
with_replacement |
Do the sampling with or without replacement (default is TRUE) |
names |
Names for columns in |
This is a direct port from richfitz/wood with nothing other than stylistic changes.
It assumes that the taxonomy is structured into order / family /
genus. Trait data are assumed in columns called "n0" and "n1",
unless alternative names are passed through in names
. A
column called "N" must be present that has the estimate of the
number of species within the genus.
So dat
must have columns:
order
family
genus
n1 (unless renamed by names
)
n0 (unless renamed by names
)
N (must be at least n0 + n1)
The function returns a big list with elements:
genus: estimates at the level of genus
family: estimates at the level of family
order: estimates at the level of order
overall: overall estimates
each element is a data.frame with columns
n0, n1: observed numbers of species in each state, possibly renamed
N: number of species at that taxonomic level
K: number of species with known states
mean, lower, upper: mean and lower/upper bounds on the estimated number of species in state 1
p_mean, p_lower, p_upper: mean and lower/upper bounds on the estimated fraction of species in state 1
1 2 3 4 5 6 | ## Data from "How much of the world is woody?"
wood <- load_wood()
## Fill in missing woodiness data; this says that the "H" column
## is state 0 and the "W" column is state 1, so that the generated
## percentages are "percentage woody" and not "percentage herbacious.
res <- traitfill(wood, 50, names=c("H", "W"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.