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 data frame 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 data frame 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()

Examples

read_types()
#> # A tibble: 110 × 25
#>    type    typelevel main_type type_name type_shortname typeclass typeclass_name
#>    <fct>   <fct>     <fct>     <fct>     <fct>          <fct>     <fct>         
#>  1 1130    main_type 1130      Estuaries Estuaries      CH        Coastal and h…
#>  2 1140    main_type 1140      Mudflats… Mud- and sand… CH        Coastal and h…
#>  3 1310    main_type 1310      Salicorn… Brackish pion… CH        Coastal and h…
#>  4 1310_p… subtype   1310      Salicorn… Salicornia ha… CH        Coastal and h…
#>  5 1310_zk subtype   1310      Low salt… Low saltmarsh… CH        Coastal and h…
#>  6 1310_zv subtype   1310      High sal… High saltmars… CH        Coastal and h…
#>  7 1320    main_type 1320      Spartina… Spartina swar… CH        Coastal and h…
#>  8 1330    main_type 1330      Atlantic… Atlantic salt… CH        Coastal and h…
#>  9 1330_da subtype   1330      Saltmars… Saltmarshes d… CH        Coastal and h…
#> 10 1330_h… subtype   1330      Halophyt… Halophytic gr… CH        Coastal and h…
#> # ℹ 100 more rows
#> # ℹ 18 more variables: hydr_class <fct>, hydr_class_name <fct>,
#> #   hydr_class_shortname <fct>, 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>, …
read_types(lang = "nl")
#> # A tibble: 110 × 25
#>    type    typelevel main_type type_name type_shortname typeclass typeclass_name
#>    <fct>   <fct>     <fct>     <fct>     <fct>          <fct>     <fct>         
#>  1 1130    main_type 1130      Estuaria  estuaria       CH        Kust- en zilt…
#>  2 1140    main_type 1140      Bij eb d… bij eb droogv… CH        Kust- en zilt…
#>  3 1310    main_type 1310      Eenjarig… zilte pionier… CH        Kust- en zilt…
#>  4 1310_p… subtype   1310      Binnendi… binnendijkse … CH        Kust- en zilt…
#>  5 1310_zk subtype   1310      Buitendi… buitendijks l… CH        Kust- en zilt…
#>  6 1310_zv subtype   1310      Buitendi… buitendijks h… CH        Kust- en zilt…
#>  7 1320    main_type 1320      Schorren… schorren met … CH        Kust- en zilt…
#>  8 1330    main_type 1330      Atlantis… Atlantische s… CH        Kust- en zilt…
#>  9 1330_da subtype   1330      Buitendi… buitendijks s… CH        Kust- en zilt…
#> 10 1330_h… subtype   1330      Binnendi… zilte graslan… CH        Kust- en zilt…
#> # ℹ 100 more rows
#> # ℹ 18 more variables: hydr_class <fct>, hydr_class_name <fct>,
#> #   hydr_class_shortname <fct>, 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>, …