Learn R Programming

ForestElementsR (version 2.0.1)

format.fe_species_ger_nfi_2012: Formatted Output of an fe_species_ger_nfi_2012 Vector

Description

Usually, this function is not required to be called explicitly. It Will always be used automatically, when an object of type fe_species_ger_nfi_2012 is printed, be it alone, be it as part of another object (e.g. a tibble)

Usage

# S3 method for fe_species_ger_nfi_2012
format(x, spec_lang = options("fe_spec_lang")$fe_spec_lang, ...)

Value

A character vector either displaying the original species codes provided in x, or the species (group) names in the desired language

Arguments

x

An object of type fe_species_ger_nfi_2012

spec_lang

Choice of how species (group) names or id's are displayed. Supported choices are "code" (displays the species codes as they are), "eng" (English species names), "ger" (German species names), and "sci" (scientific species names). The names and the codes refer to the species coding given in the object's attribute species_coding. The default is to request the choice with options("fe_spec_lang"). If this option is not set, the choice "code" is used.

...

Other parameters (not used)

Examples

Run this code
# Create an fe_species_ger_nfi_2012 object
spec_ids <- fe_species_ger_nfi_2012(
  as.character(c(10, 20, 30, 40, 50, 100, 110, 120, 130, 140, 150, 170))
)

# Display in default style, scientific names, English, and German names
format(spec_ids)
format(spec_ids, spec_lang = "sci")
format(spec_ids, spec_lang = "eng")
format(spec_ids, spec_lang = "ger")

# Usual application: Set option for species code output
# Any print of an fe_species object will use the last setting of the option
options(fe_spec_lang = "eng")
spec_ids

Run the code above in your browser using DataLab