Description Usage Arguments Details Value Author(s) Examples
View source: R/demography_ctfs.R
These functions are adapted from the CTFS-R package. Compared to the original functions, these ones have a similar interface but use more conservative defaults and allow suppressing messages. These functions also feature formal tests, bug fixes, additional assertions, and improved messages.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | recruitment_ctfs(
census1,
census2,
mindbh = NULL,
alivecode = NULL,
split1 = NULL,
split2 = NULL,
quiet = FALSE
)
mortality_ctfs(
census1,
census2,
alivecode = NULL,
split1 = NULL,
split2 = NULL,
quiet = FALSE
)
growth_ctfs(
census1,
census2,
rounddown = FALSE,
method = "I",
stdev = FALSE,
dbhunit = "mm",
mindbh = NULL,
growthcol = "dbh",
err.limit = 1000,
maxgrow = 1000,
split1 = NULL,
split2 = NULL,
quiet = FALSE
)
|
census1, census2 |
Two census tables, each being a ForestGEO-like tree table (dataframe). A stem table won't fail, but you should use a tree table because demography analyses make more sense at the scale of trees than at the scale of stems. |
mindbh |
The minimum diameter above which the counts are done. Trees
smaller than |
alivecode |
Character; valid values of |
split1, split2 |
Optional vector(s) to aggregate results by. Each vector
should be a column of either |
quiet |
Use |
rounddown |
If |
method |
Either "I" or "E":
|
stdev |
Logical:
|
dbhunit |
"cm" or "mm". |
growthcol |
Either "dbh" or "agb" to define how growth is measured. |
err.limit, maxgrow |
A number. Numbers such as 10000 are high and will return all measures. |
Survivors are all individuals alive in both censuses, with status == A
in
the first census, and a diameter greater than mindbh
in the first census.
The total population in the second census includes all those alive plus any
other survivors. Individuals whose status is NA
in either census are
deleted from all calculations.
Metrics of recruitment: Similar to metrics of mortality.
Metrics of mortality:
N
: the number of individuals alive in the census 1 per category
selected.
D
: the number of individuals no longer alive in census 2.
rate
: the mean annualized mortality rate constant per category
selected, calculated as (log(N)-log(S))/time.
upper
: upper confidence limit of mean rate.
lower
: lower confidence limit of mean rate.
time
: mean time interval in years.
date1
: mean date included individuals were measured in census 1, as
julian object (R displays as date, but treats as integer).
date2
: mean date in census 2.
dbhmean
: mean dbh in census 1 of individuals included.
Metrics of growth:
rate
, the mean annualized growth rate per category selected, either dbh
increment, or relative growth.
N
, the number of individuals included in the mean (not counting any
excluded).
clim
(or sd with stdev = TRUE
), width of confidence interval; add this
number to the mean rate to get upper confidence limit, substract to get
lower.
dbhmean
, mean dbh in census 1 of individuals included.
time
, mean time interval in years.
date1
, mean date included individuals were measured in census 1, as
julian object (R displays as date, but treats as integer).
date2
, mean date in census 2.
Richard Condit, Suzanne Lao.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | assert_is_installed("fgeo.x")
census1 <- fgeo.x::tree5
census2 <- fgeo.x::tree6
as_tibble(
recruitment_ctfs(census1, census2)
)
# Use `interaction(...)` to aggregate by any number of grouping variables
sp_quadrat <- interaction(census1$sp, census1$quadrat)
recruitment <- recruitment_ctfs(
census1, census2,
split1 = sp_quadrat,
quiet = TRUE
)
as_tibble(recruitment)
mortality <- mortality_ctfs(
census1, census2,
split1 = sp_quadrat, quiet = TRUE
)
as_tibble(mortality)
growth <- growth_ctfs(census1, census2, split1 = sp_quadrat, quiet = TRUE)
as_tibble(growth)
# Easy way to separate grouping variables
tidyr_is_installed <- requireNamespace("tidyr", quietly = TRUE)
if (tidyr_is_installed) {
library(tidyr)
as_tibble(growth) %>%
separate(groups, into = c("sp", "quadrat"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.