Returns the included data source types as a tibble. Names and shortnames from namelist are added, in English by default.

read_types(
  path = pkgdatasource_path("textdata/types", ".yml"),
  file = "types",
  file_namelist = "namelist",
  lang = "en"
)

Arguments

path

Location of the data sources types and namelist. The default is to use the location of the data sources as delivered by the installed package.

file

The filename of the types data source, without extension. The default is to use the file delivered by the installed package.

file_namelist

The filename of the namelist data source, without extension. The default is to use the file delivered by the installed package.

lang

An IETF BCP 47 language tag, such as "en" or "nl", to specify the language of names & shortnames to be returned in the tibble.

Value

The types dataframe as a tibble, with names & shortnames added for types, attributes and tags according to the lang argument. See types for documentation of the data-source's contents. See namelist for the link between codes or other identifiers and the corresponding names (and shortnames).

The added names and shortnames are represented by the following variables:

  • type_name

  • type_shortname

  • typeclass_name

  • hydr_class_name

  • hydr_class_shortname

  • groundw_dep_name

  • groundw_dep_shortname

  • flood_dep_name

  • flood_dep_shortname

  • tag_1_name

  • tag_1_shortname

  • tag_2_name

  • tag_2_shortname

  • tag_3_name

  • tag_3_shortname

Except for the tags, the names and shortnames are factors with their level order according to that of the corresponding attribute.

Details

types is a data source in the vc-format which provides a checklist of types, represented by their current codes, together with several attributes. A 'type' refers to either a (main) habitat type, a habitat subtype or a regionally important biotope (RIB).

read_types() reads the types data source, adds names + shortnames and returns it as a tibble. A tibble is a dataframe that makes working in the tidyverse a little easier. By default, the data version delivered with the package is used and English names (lang = "en") are returned for types, attributes and tags.

Note that factors are generated with implicit NA values (i.e. there is no factor level to represent the missing values). If you want this category to appear in certain results, you can convert such variables with forcats::fct_explicit_na().

read_types()

read_types(lang = "nl")

See also

types

Other reading functions for n2khab-referencelists: read_env_pressures(), read_namelist(), read_scheme_types(), read_schemes()

Examples

read_types()
#> # A tibble: 111 × 25
#>    type  typel…¹ main_…² type_…³ type_…⁴ typec…⁵ typec…⁶ hydr_…⁷ hydr_…⁸ hydr_…⁹
#>    <fct> <fct>   <fct>   <fct>   <fct>   <fct>   <fct>   <fct>   <fct>   <fct>  
#>  1 1130  main_t… 1130    Estuar… Estuar… CH      Coasta… HC3     Surfac… Surfac…
#>  2 1140  main_t… 1140    Mudfla… Mud- a… CH      Coasta… HC2     Tempor… Wet    
#>  3 1310  main_t… 1310    Salico… Bracki… CH      Coasta… HC2     Tempor… Wet    
#>  4 1310… subtype 1310    Salico… Salico… CH      Coasta… HC2     Tempor… Wet    
#>  5 1310… subtype 1310    Low sa… Low sa… CH      Coasta… HC2     Tempor… Wet    
#>  6 1310… subtype 1310    High s… High s… CH      Coasta… HC2     Tempor… Wet    
#>  7 1320  main_t… 1320    Sparti… Sparti… CH      Coasta… HC2     Tempor… Wet    
#>  8 1330  main_t… 1330    Atlant… Atlant… CH      Coasta… HC2     Tempor… Wet    
#>  9 1330… subtype 1330    Saltma… Saltma… CH      Coasta… HC2     Tempor… Wet    
#> 10 1330… subtype 1330    Haloph… Haloph… CH      Coasta… HC2     Tempor… Wet    
#> # … with 101 more rows, 15 more variables: groundw_dep <fct>,
#> #   groundw_dep_name <fct>, groundw_dep_shortname <fct>, flood_dep <fct>,
#> #   flood_dep_name <fct>, flood_dep_shortname <fct>, tag_1 <chr>,
#> #   tag_1_name <chr>, tag_1_shortname <chr>, tag_2 <chr>, tag_2_name <chr>,
#> #   tag_2_shortname <chr>, tag_3 <chr>, tag_3_name <chr>,
#> #   tag_3_shortname <chr>, and abbreviated variable names ¹​typelevel,
#> #   ²​main_type, ³​type_name, ⁴​type_shortname, ⁵​typeclass, ⁶​typeclass_name, …
read_types(lang = "nl")
#> # A tibble: 111 × 25
#>    type  typel…¹ main_…² type_…³ type_…⁴ typec…⁵ typec…⁶ hydr_…⁷ hydr_…⁸ hydr_…⁹
#>    <fct> <fct>   <fct>   <fct>   <fct>   <fct>   <fct>   <fct>   <fct>   <fct>  
#>  1 1130  main_t… 1130    Estuar… estuar… CH      Kust- … HC3     Opperv… Opperv…
#>  2 1140  main_t… 1140    Bij eb… bij eb… CH      Kust- … HC2     Tijdel… Nat    
#>  3 1310  main_t… 1310    Eenjar… zilte … CH      Kust- … HC2     Tijdel… Nat    
#>  4 1310… subtype 1310    Binnen… binnen… CH      Kust- … HC2     Tijdel… Nat    
#>  5 1310… subtype 1310    Buiten… buiten… CH      Kust- … HC2     Tijdel… Nat    
#>  6 1310… subtype 1310    Buiten… buiten… CH      Kust- … HC2     Tijdel… Nat    
#>  7 1320  main_t… 1320    Schorr… schorr… CH      Kust- … HC2     Tijdel… Nat    
#>  8 1330  main_t… 1330    Atlant… Atlant… CH      Kust- … HC2     Tijdel… Nat    
#>  9 1330… subtype 1330    Buiten… buiten… CH      Kust- … HC2     Tijdel… Nat    
#> 10 1330… subtype 1330    Binnen… zilte … CH      Kust- … HC2     Tijdel… Nat    
#> # … with 101 more rows, 15 more variables: groundw_dep <fct>,
#> #   groundw_dep_name <fct>, groundw_dep_shortname <fct>, flood_dep <fct>,
#> #   flood_dep_name <fct>, flood_dep_shortname <fct>, tag_1 <chr>,
#> #   tag_1_name <chr>, tag_1_shortname <chr>, tag_2 <chr>, tag_2_name <chr>,
#> #   tag_2_shortname <chr>, tag_3 <chr>, tag_3_name <chr>,
#> #   tag_3_shortname <chr>, and abbreviated variable names ¹​typelevel,
#> #   ²​main_type, ³​type_name, ⁴​type_shortname, ⁵​typeclass, ⁶​typeclass_name, …