check_inputs | R Documentation |
Functions to check and correct spatial inputs for simulations
check_topography(
x,
missing_action = "no_action",
default_values = c(elevation = 0, slope = NA, aspect = NA),
verbose = TRUE
)
check_land_cover(
x,
missing_action = "no_action",
default_values = "wildland",
verbose = TRUE
)
check_forests(
x,
SpParams = NULL,
missing_action = "no_action",
progress = FALSE,
verbose = TRUE
)
check_soils(
x,
check_equal_layers = FALSE,
missing_action = "no_action",
default_values = c(clay = 25, sand = 25, bd = 1.5, rfc = 25),
progress = FALSE,
verbose = TRUE
)
x |
An object of class |
missing_action |
Action to perform for missing values, either "no_action" (for checks), "filter" (filter missing data), "default" (impute default values) |
default_values |
Vector of default values for locations with missing data. |
verbose |
Logical flag to indicate extra console output. |
SpParams |
A data frame with species parameters (see |
progress |
A logical flag to print information about progress. |
check_equal_layers |
Logical flag to test whether soils have the same number of layers. |
Function check_topography()
checks that columns "elevation"
, "slope"
and "aspect"
do not contain missing values.
Function check_land_cover()
checks that column "land_cover_type"
does not contain missing values.
Function check_forests()
checks first that forest
objects are defined in "wildland" locations. Then, it looks for missing
data in tree or shrub attributes required for simulations. If SpParams
is provided, the function also checks
whether species names are within the taxa represented in SpParams
.
Function check_soils()
checks first that "wildland" and "agriculture" locations have a defined soil object. Then it looks for missing data in required
soil physical parameters.
All functions return a modified sf
object if missing_action
is either "filter"
or "default"
. Otherwise,
they return an invisible tibble with logical columns indicating where missing information is.
data(example_ifn)
check_topography(example_ifn)
check_land_cover(example_ifn)
check_forests(example_ifn)
check_soils(example_ifn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.