validate_fe_species_master {ForestElementsR} | R Documentation |
Validate an fe_species_master Object
Description
Regular users will not require this function. Expert users will want to use
it in combination with the constructor new_fe_species_master
.
Regular users, please construct fe_species_master
objects with
fe_species_master
.
Usage
validate_fe_species_master(x = character())
Arguments
x |
An object that is expected to be a correct
|
Value
Returns x
, but this function is mainly called for its side
effect which is pointing out any violations of the
fe_species_master
object specifications. In case of such
violations, the function will terminate with an error.
Examples
# Passes validation
spec_ids <- c("pinus_001", "quercus_002", "pinus_001", "fagus_001")
spec_ids <- new_fe_species_master(spec_ids)
validate_fe_species_master(spec_ids)
# Validating the following spec_ids throws an error due to
# non-supported species codes
spec_ids <- c("pinus_001", "my_awesome_species_003", "wonder_tree_3012")
spec_ids <- new_fe_species_master(spec_ids)
try(
validate_fe_species_master(spec_ids)
)
[Package ForestElementsR version 2.1.0 Index]