Skip to contents

Convert (crosswalk) habitat codes from, and to, the following habitat classification systems:

  • EUNIS habitat classification: "EUNIS_2012", "EUNIS_M_2019", "EUNIS_M_2022" and "EUNIS_T_2021". See eunis_habitats for these habitat codes, names and descriptions.

  • European Red List of Habitats: "RL".

  • Habitats Directive Annex I: "Annex_I".

Note that not all pairwise combinations are available. The possibilities are those originally provided in EUNIS raw data.

Usage

crosswalk(code, from, to, unnest = FALSE)

Arguments

code

A character vector of habitat codes. These values should be existing codes in the classification system indicated in the from parameter.

from

The source classification system. Should be one of: "EUNIS_2012", "EUNIS_M_2019", "EUNIS_M_2022", "EUNIS_T_2021", "RL" or "Annex_I".

to

The target classification system. Also, one of the options indicated in from parameter description.

unnest

Whether to unnest the "to" column in the output. Note that if you do unnest then the number of rows in the output will be (potentially) greater than the number of habitat codes provided in the parameter code, meaning that the one-to-many crosswalks will be on one row each.

Value

A tibble of two variables with the from and to codes, respectively. The actual column names will vary according to the specific crosswalk queried, see Examples.

Examples

# From EUNIS 2012 to EUNIS Marine 2022
crosswalk(
  code = c("A3.4", "A3.5"),
  from = "EUNIS_2012",
  to = "EUNIS_M_2022",
  unnest = TRUE
)
#> # A tibble: 64 × 2
#>    eunis_2012_code eunis_m_2022_code
#>    <chr>           <chr>            
#>  1 A3.4            MA133            
#>  2 A3.4            MA134            
#>  3 A3.4            MA135            
#>  4 A3.4            MA136            
#>  5 A3.4            MA137            
#>  6 A3.4            MB13             
#>  7 A3.4            MB131            
#>  8 A3.4            MB1311           
#>  9 A3.4            MB1312           
#> 10 A3.4            MB1313           
#> # ℹ 54 more rows

# From EUNIS Marine 2019 to EUNIS 2012
crosswalk(
code = c("MH152", "MH2331"),
from = "EUNIS_M_2019",
to = "EUNIS_2012",
unnest = TRUE
)
#> # A tibble: 2 × 2
#>   eunis_m_2019_code eunis_2012_code
#>   <chr>             <chr>          
#> 1 MH152             A7.12          
#> 2 MH2331            A7.231         

# From EUNIS Marine 2022 to Red List
crosswalk(
code = c("MH152", "MH2331", "MA146", "MD55"),
from = "EUNIS_M_2022",
to = "RL",
unnest = TRUE
)
#> # A tibble: 4 × 2
#>   eunis_m_2022_code rl_code
#>   <chr>             <chr>  
#> 1 MH152             NA     
#> 2 MH2331            NA     
#> 3 MA146             A1.1xx 
#> 4 MD55              A5.27  

# From EUNIS Marine 2019 to Annex I
crosswalk(
code = c("M", "MA1", "MA11", "MA12"),
from = "EUNIS_M_2019",
to = "Annex_I", unnest = TRUE
)
#> # A tibble: 7 × 2
#>   eunis_m_2019_code annex_i_code
#>   <chr>             <chr>       
#> 1 M                 NA          
#> 2 MA1               NA          
#> 3 MA11              NA          
#> 4 MA12              8330        
#> 5 MA12              1160        
#> 6 MA12              1170        
#> 7 MA12              1130        

# From Annex I to EUNIS Marine 2019
crosswalk(
code = c("8330", "1160"),
from = "Annex_I",
to = "EUNIS_M_2019", unnest = TRUE
)
#> # A tibble: 966 × 2
#>    annex_i_code eunis_m_2019_code
#>    <chr>        <chr>            
#>  1 8330         MA12             
#>  2 8330         MA127            
#>  3 8330         MA1271           
#>  4 8330         MA1272           
#>  5 8330         MA1273           
#>  6 8330         MA1274           
#>  7 8330         MA1275           
#>  8 8330         MA1276           
#>  9 8330         MA12761          
#> 10 8330         MA1277           
#> # ℹ 956 more rows

# From EUNIS Terrestrial 2021 to Annex I
crosswalk(
code = c("U51", "U72", "Q25"),
from = "EUNIS_T_2021",
to = "Annex_I", unnest = TRUE
)
#> # A tibble: 6 × 2
#>   eunis_t_2021_code annex_i_code
#>   <chr>             <chr>       
#> 1 U72               3250        
#> 2 U72               3280        
#> 3 U72               3290        
#> 4 Q25               7140        
#> 5 Q25               7130        
#> 6 U51               NA          

# From Annex I to EUNIS Terrestrial 2021
crosswalk(
  code = c("91E0", "92A0", "9030"),
  from = "Annex_I",
  to = "EUNIS_T_2021", unnest = TRUE
  )
#> # A tibble: 6 × 2
#>   annex_i_code eunis_t_2021_code
#>   <chr>        <chr>            
#> 1 92A0         T11              
#> 2 92A0         T14              
#> 3 9030         T12              
#> 4 9030         T1C              
#> 5 91E0         T11              
#> 6 91E0         T12