View source: R/fe_species_ger_nfi_2012.R
fe_species_ger_nfi_2012 | R Documentation |
User interface for constructing a vector of species codes follwing the fe_species_ger_nfi_2012 convention
fe_species_ger_nfi_2012(x = character())
x |
Input vector to become a vector of tree species codes by the
definition ger_nfi_2012. Any type of vector (typically
|
The ger_nfi_2012 species coding is the species coding used by the German National Forest Inventory of 2012. See the example section for how to look up the coding.
If the user input allows to construct a well-defined
fe_species_ger_nfi_2012
object, this object will be returned. If
not, the function will terminate with an error.
# Libraries required for the following two examples
library(dplyr)
library(purrr)
# Look up the ger_nfi_2012 species codes for all supported species
# the column species_id contains the ger_nfi_2012 codes
species_codings |>
filter(species_coding == "ger_nfi_2012") |>
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 ger_nfi_2012 species code
species_codings |>
filter(species_coding == "ger_nfi_2012") |>
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_ger_nfi_2012 vector from a vector of integer codes
spec_ids <- fe_species_ger_nfi_2012(
c(10, 10, 10, 100, 100, 100, 100, 20, 20, 190, 290, 190)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.