prepare rodents | R Documentation |
prepare_dataset
is the workhorse function for creating portalcasting rodent datasets using existing functions.
Wraps around portalr::summarize_rodent_data
to produce a data.frame
associated with a set of data specifications. Inputs are ready for implementation via prepare_rodents
.
prepare_rodents
creates specified datasets
using their associated function (typically prepare_dataset
) and arguments, according to the directory_settings
.
prepare_abundance
creates a model-ready vector of abundances for fitting and casting, according to the model's requirements and time settings.
prepare_abundance(main = ".", dataset = NULL, species = NULL, model = NULL)
prepare_rodents(
main = ".",
datasets = prefab_datasets(),
new_datasets_controls = NULL
)
prepare_dataset(
name = "all",
main = ".",
filename = "rodents_all.csv",
clean = FALSE,
level = "Site",
type = "Rodents",
plots = "all",
unknowns = FALSE,
shape = "crosstab",
time = "newmoon",
output = "abundance",
fillweight = FALSE,
treatment = NULL,
na_drop = FALSE,
zero_drop = FALSE,
min_traps = 1,
min_plots = 24,
effort = TRUE,
species = prefab_species(main = main),
total = TRUE,
save = TRUE
)
read_datasets_controls(main = ".")
datasets_controls(main = ".", datasets = NULL)
write_datasets_controls(
main = ".",
new_datasets_controls = NULL,
datasets = prefab_datasets()
)
main |
|
dataset, datasets |
|
species |
|
model |
|
new_datasets_controls |
Optional |
name |
|
filename |
|
clean |
|
level |
|
type |
|
plots |
Specification of subset of plots. Can be a vector of |
unknowns |
|
shape |
|
time |
|
output |
|
fillweight |
|
treatment |
|
na_drop |
|
zero_drop |
|
min_traps |
|
min_plots |
|
effort |
|
total |
|
save |
|
prepare_dataset
: data.frame
for the specified dataset.
prepare_rodents
: list
of data.frame
s for the specified datasets.
prepare_abundance
: numeric
vector of abundance data corresponding to the time articulated in the metadata file. Missing values are interpolated if requested via the model controls.
read_datasets_controls
, write_datasets_controls
, datasets_controls
: list
of datasets
' control list
s, invisible
-ly for write_datasets_controls
.
Content preparation functions:
directory filling
,
prepare covariates
,
prepare metadata
,
prepare models
,
prepare newmoons
## Not run:
main1 <- file.path(tempdir(), "rodents")
create_dir(main = main1)
fill_resources(main = main1)
fill_forecasts(main = main1)
fill_fits(main = main1)
fill_models(main = main1)
prepare_newmoons(main = main1)
prepare_rodents(main = main1)
write_datasets_controls(main = main1)
read_datasets_controls(main = main1)
datasets_controls(main = main1)
unlink(main1, recursive = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.