Learn R Programming

ForestElementsR (version 2.0.1)

summary.fe_species_tum_wwk_short: Summary of an fe_species_tum_wwk_short Vector

Description

Produces a summary for a fe_species_tum_wwk_short object in the same style as R does for factors. Actually, after some conversions summary.factor is called by this function. The species naming in the summary depends on the parameter spec_lang.

Usage

# S3 method for fe_species_tum_wwk_short
summary(
  object,
  spec_lang = options("fe_spec_lang")$fe_spec_lang,
  maxsum = 100L,
  ...
)

Value

A named vector in the same style as returned by summary.factor

Arguments

object

Object of class fe_species_tum_wwk_short

spec_lang

Choice of how species (group) names or id's are displayed in the summary. 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.

maxsum

Same as parameter maxsum in summary.factor

...

Other parameters (not used)

Examples

Run this code
# Construct some species id vector
spec_ids <- c(
  rep(fe_species_tum_wwk_short(as.character(1:10)), each = 5), NA
)

summary(spec_ids)
spec_ids |> summary()
spec_ids |> summary(spec_lang = "eng")

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

# The summary is also used in the summary of a data frame which contains
# an fe_species object, but displayed differently
options(fe_spec_lang = "eng")
selection_forest_1_fe_stand$trees |> summary()

Run the code above in your browser using DataLab