vignettes/v010_reference_lists.Rmd
v010_reference_lists.Rmd
With reference lists we mean complete and authorative lists of all items or categories that constitute some collection. Their purpose is typically to promote standardization and thereby to ease collaborative work.
The n2khab
package provides the following built-in
reference lists, relevant to N2KHAB projects 1:
types
: checklist of types (habitat (sub)types and
regionally important biotopes) (documentation links: this website / installed package), represented by their
current codesenv_pressures
: checklist of environmental pressures,
represented by codes (documentation links: this website / installed package)schemes
: list of schemes 2 for N2KHAB monitoring
programmes or other N2KHAB projects (documentation links: this website / installed package)scheme_types
: lists the types that belong to each
N2KHAB scheme, and optionally defines typegroups within a scheme
(documentation links: this
website / installed
package)Additionally, namelist
provides names and (optionally)
shortnames for IDs/codes used in the above lists (documentation links:
this website / installed package).
Beside enlisting all items, the reference lists provide additional information on them, sometimes in a generic way with variables like ‘attribute_1’, ‘attribute_2’, ‘tag_1’ and so on (explained in the documentation files). This information may be of a defining nature (and obligate), or may just provide useful categories and tags to filter by.
Reading functions of the n2khab
package return the
reference lists as tibbles, with appropriate text from
namelist
added. A tibble is a dataframe that makes working
in the tidyverse a little easier.
In the data source on disk, each item envisaged by a reference list is always represented by a code (sometimes a combination of two codes) – not a name. The same approach is often followed for other attributes (use of codes, not names or descriptions). However for some variables English has been used directly in the data source.
The splitting between code and explanatory names, shortnames and
other language-dependent text made it possible to store the latter in
multiple languages in namelist
, in the variables
name
and shortname
. Currently, this list
systematically provides English and Dutch text for each code. This can
be extended in future versions of the package (not necessarily in a
systematic way).
Making the types
reference list available in the R
environment is as easy as:
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, …
By default, English is used. But, you can also choose to get a tibble in another language:
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, …
The lang
argument is available in the below functions as
well.
env_pressures
is made available with:
read_env_pressures()
#> # A tibble: 35 × 7
#> ep_code ep_abbrev ep_name ep_cl…¹ ep_cl…² expla…³ remarks
#> <fct> <fct> <fct> <fct> <fct> <chr> <chr>
#> 1 ep_011 011_struct 11 Change of physic… ep_cla… 1 Phys… <NA> <NA>
#> 2 ep_012 012_soildyn_incr 12 Soil dynamics in… ep_cla… 1 Phys… <NA> <NA>
#> 3 ep_013 013_soildyn_decr 13 Soil dynamics de… ep_cla… 1 Phys… <NA> <NA>
#> 4 ep_014 014_aqconn 14 Aquatic connecti… ep_cla… 1 Phys… <NA> <NA>
#> 5 ep_015 015_terrconn 15 Terrestrial conn… ep_cla… 1 Phys… <NA> <NA>
#> 6 ep_03.1 03.1_eutr_air 3.1 Eutrophication … ep_cla… 3 Eutr… <NA> <NA>
#> 7 ep_03.2 03.2_eutr_soil 3.2 Eutrophication … ep_cla… 3 Eutr… <NA> <NA>
#> 8 ep_03.3 03.3_eutr_gw 3.3 Eutrophication … ep_cla… 3 Eutr… <NA> <NA>
#> 9 ep_03.4 03.4_eutr_sw 3.4 Eutrophication … ep_cla… 3 Eutr… <NA> <NA>
#> 10 ep_04.1 04.1_acidif_air 4.1 Acidification t… ep_cla… 4 Acid… <NA> <NA>
#> # … with 25 more rows, and abbreviated variable names ¹ep_class,
#> # ²ep_class_name, ³explanation
When actually using these reading functions, you will – of course –
assign its result to an object. E.g. with the schemes
reference list:
schemes <- read_schemes()
schemes
#> # A tibble: 64 × 25
#> scheme schem…¹ schem…² progr…³ progr…⁴ attri…⁵ attri…⁶ attri…⁷ attri…⁸
#> <fct> <fct> <fct> <fct> <fct> <fct> <fct> <fct> <fct>
#> 1 ATM_03.1 Atmosp… ATM: 0… MNE Monito… ATM ep_03.1 <NA> Atmosp…
#> 2 ATM_04.1 Atmosp… ATM: 0… MNE Monito… ATM ep_04.1 <NA> Atmosp…
#> 3 ATM_08.1 Atmosp… ATM: 0… MNE Monito… ATM ep_08.1 <NA> Atmosp…
#> 4 ATM_101 Atmosp… ATM: 1… MNE Monito… ATM ep_101 <NA> Atmosp…
#> 5 ATM_102 Atmosp… ATM: 1… MNE Monito… ATM ep_102 <NA> Atmosp…
#> 6 GW_03.3 Ground… GW: 03… MNE Monito… GW ep_03.3 <NA> Ground…
#> 7 GW_04.2 Ground… GW: 04… MNE Monito… GW ep_04.2 <NA> Ground…
#> 8 GW_05.1_aq Ground… GW: 05… MNE Monito… GW ep_05.1 aq Ground…
#> 9 GW_05.1_quar… Ground… GW: 05… MNE Monito… GW ep_05.1 quarri… Ground…
#> 10 GW_05.1_terr Ground… GW: 05… MNE Monito… GW ep_05.1 terr Ground…
#> # … with 54 more rows, 16 more variables: attribute_1_shortname <fct>,
#> # attribute_2_name <fct>, attribute_2_shortname <fct>,
#> # attribute_3_name <fct>, attribute_3_shortname <fct>,
#> # spatial_restriction <chr>, notes <chr>, tag_1 <chr>, tag_2 <chr>,
#> # tag_3 <chr>, tag_1_name <chr>, tag_1_shortname <chr>, tag_2_name <chr>,
#> # tag_2_shortname <chr>, tag_3_name <chr>, tag_3_shortname <chr>, and
#> # abbreviated variable names ¹scheme_name, ²scheme_shortname, ³programme, …
The read_scheme_types()
function provides the extra
ability to toggle the presence of most textual information,
because these comprise many extra variables (combining all additional
information of the concerned schemes and the types). This
behaviour is controlled by the argument extended
, which is
FALSE
by default.
read_scheme_types()
#> # A tibble: 764 × 5
#> scheme type typegroup typegroup_name typegroup…¹
#> <fct> <fct> <fct> <fct> <fct>
#> 1 ATM_03.1 1310_pol ATM_03.1_group2 sensitive non-forest types sensitive …
#> 2 ATM_03.1 1310_zk ATM_03.1_group2 sensitive non-forest types sensitive …
#> 3 ATM_03.1 1310_zv ATM_03.1_group2 sensitive non-forest types sensitive …
#> 4 ATM_03.1 1320 ATM_03.1_group2 sensitive non-forest types sensitive …
#> 5 ATM_03.1 1330_da ATM_03.1_group2 sensitive non-forest types sensitive …
#> 6 ATM_03.1 1330_hpr ATM_03.1_group2 sensitive non-forest types sensitive …
#> 7 ATM_03.1 2110 ATM_03.1_group2 sensitive non-forest types sensitive …
#> 8 ATM_03.1 2120 ATM_03.1_group2 sensitive non-forest types sensitive …
#> 9 ATM_03.1 2130_had ATM_03.1_group1 very sensitive non-forest types very sensi…
#> 10 ATM_03.1 2130_hd ATM_03.1_group1 very sensitive non-forest types very sensi…
#> # … with 754 more rows, and abbreviated variable name ¹typegroup_shortname
read_scheme_types(extended = TRUE)
#> # A tibble: 764 × 53
#> scheme type typeg…¹ typeg…² typeg…³ schem…⁴ schem…⁵ progr…⁶ progr…⁷ attri…⁸
#> <fct> <fct> <fct> <fct> <fct> <fct> <fct> <fct> <fct> <fct>
#> 1 ATM_03… 1310… ATM_03… sensit… sensit… Atmosp… ATM: 0… MNE Monito… ATM
#> 2 ATM_03… 1310… ATM_03… sensit… sensit… Atmosp… ATM: 0… MNE Monito… ATM
#> 3 ATM_03… 1310… ATM_03… sensit… sensit… Atmosp… ATM: 0… MNE Monito… ATM
#> 4 ATM_03… 1320 ATM_03… sensit… sensit… Atmosp… ATM: 0… MNE Monito… ATM
#> 5 ATM_03… 1330… ATM_03… sensit… sensit… Atmosp… ATM: 0… MNE Monito… ATM
#> 6 ATM_03… 1330… ATM_03… sensit… sensit… Atmosp… ATM: 0… MNE Monito… ATM
#> 7 ATM_03… 2110 ATM_03… sensit… sensit… Atmosp… ATM: 0… MNE Monito… ATM
#> 8 ATM_03… 2120 ATM_03… sensit… sensit… Atmosp… ATM: 0… MNE Monito… ATM
#> 9 ATM_03… 2130… ATM_03… very s… very s… Atmosp… ATM: 0… MNE Monito… ATM
#> 10 ATM_03… 2130… ATM_03… very s… very s… Atmosp… ATM: 0… MNE Monito… ATM
#> # … with 754 more rows, 43 more variables: attribute_2 <fct>,
#> # attribute_3 <fct>, attribute_1_name <fct>, attribute_1_shortname <fct>,
#> # attribute_2_name <fct>, attribute_2_shortname <fct>,
#> # attribute_3_name <fct>, attribute_3_shortname <fct>,
#> # spatial_restriction <chr>, notes <chr>, schemetag_1 <chr>,
#> # schemetag_1_name <chr>, schemetag_1_shortname <chr>, schemetag_2 <chr>,
#> # schemetag_2_name <chr>, schemetag_2_shortname <chr>, schemetag_3 <chr>, …
When you request all this extra information (some of which is
currently empty), you will want to select the columns that you need with
dplyr::select()
.
With N2KHAB projects, we mean scientific monitoring programmes and research projects regarding Flemish Natura 2000 habitats and regionally important biotopes (RIBs).↩︎
A ‘scheme’ refers to a monitoring or research setup that determines which types (habitat/RIBs) are to be investigated for a question or for a bunch of related questions.↩︎