validate_fe_species_tum_wwk_short {ForestElementsR} | R Documentation |
Validate an fe_species_tum_wwk_short Object
Description
Regular users will not require this function. Expert users will want to use
it in combination with the constructor
new_fe_species_tum_wwk_short
. Regular users, please construct
fe_species_tum_wwk_short
objects with
fe_species_tum_wwk_short
.
Usage
validate_fe_species_tum_wwk_short(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_tum_wwk_short
object specifications. In case of such
violations, the function will terminate with an error.
Examples
# Passes validation
spec_ids <- as.character(c(2, 2, 2, 1, 1, 1, 1, 3, 3, 9))
spec_ids <- new_fe_species_tum_wwk_short(spec_ids)
validate_fe_species_tum_wwk_short(spec_ids)
# Validating the following spec_ids throws an error due to
# non-supported species codes
spec_ids <- as.character(c(2, 2, 52, 1, 1, 1, 123, 3, 3, 9))
spec_ids <- new_fe_species_tum_wwk_short(spec_ids)
try(
validate_fe_species_tum_wwk_short(spec_ids)
)
[Package ForestElementsR version 2.1.0 Index]