fe_species_bavrn_state {ForestElementsR} | R Documentation |
Construct a fe_species_bavrn_state Species Code Vector
Description
User interface for constructing a vector of species codes follwing the fe_species_bavrn_state convention
Usage
fe_species_bavrn_state(x = character())
Arguments
x |
Input vector to become a vector of tree species codes by the
definition bavrn_state. Any type of vector (typically
|
Details
The bavrn_state species coding is the species coding used by the Bavarian State Forest Service. See the example section for how to look up the coding.
Value
If the user input allows to construct a well-defined
fe_species_bavrn_state
object, this object will be returned. If
not, the function will terminate with an error.
Examples
# Libraries required for the following two examples
library(dplyr)
library(purrr)
# Look up the bavrn_state species codes for all supported species
# the column species_id contains the bavrn_state codes
species_codings |>
filter(species_coding == "bavrn_state") |>
pluck(2, 1) |>
arrange(as.numeric(species_id)) |> # just for the look of it
print(n = Inf)
# Display a summary table which shows the number of single species behind
# each bavrn_state species code
species_codings |>
filter(species_coding == "bavrn_state") |>
pluck(2, 1) |>
group_by(name_eng, species_id) |> # display english names
summarise(n = n()) |>
arrange(as.numeric(species_id)) |> # just for the look of it
print(n = Inf)
# Make an fe_species_bavrn_state vector from a vector of integer codes
spec_ids <- fe_species_bavrn_state(
c(10, 10, 10, 60, 60, 60, 60, 30, 30, 80, 86, 80)
)
[Package ForestElementsR version 2.1.0 Index]