RL_crosswalk: Crosswalk habitat classes to a look-up table of other values

Description Usage Arguments Details Value Author(s)

View source: R/RL_crosswalk.R

Description

Rename columns to new names from look-up table - e.g. iucn_1_1 becomes 110. Then optionally replaces suitability/major importance values with the column name or 1. Typically used to convert between habitat classes and land cover classes.

Usage

1
2
3
4
5
6
7
RL_crosswalk(
  x,
  lut = redlistManipulatr::hab_conversion_lut,
  new.code.colname = NULL,
  old.code.colname = NULL,
  recode = "no"
)

Arguments

x

A wide-format dataframe with one column per habitat category. As output by RL_fetch().

lut

(optional) A dataframe look-up table of values with two columns, one for new values, one for Red List habitat classes. This can be one-to-one, one-to-many, or many-to-many. If many-to-many, the highest suitability-major importance combination is selected as the preferred value for the new value - see suitability_ordered. See details for default.

new.code.colname

(optional) Character. What is the name of the column of lut with the new values in? Defaults to being the first column.

old.code.colname

(optional) Character. What is the name of the column of lut with the old (Red List habitat class) values in? Defaults to being the second column.

recode

(optional) Character. Should values be recoded? "no" gives the most favourable suitability-major importance combinations, "one" codes all habitats with suitability-major importance values as 1, "colname" codes all habitats with suitability-major importance values as the column name value (the same as the new values in lut). Defaults to "no".

Details

Use should follow that of RL_subset_acceptable() if only some habitat suitabilities/major importances are wanted and cell values are being recoded.

The default for lut is the hab_conversion_lut dataset which just converts habitat classes to integer values - e.g. 1.1 -> 110; 9.8.1 -> 981.

Value

A dataframe in wide format (one column per new value of habitat type).

Author(s)

Matt Lewis, matthewlewis896@gmail.com


matthewlewis896/redlistManipulatr documentation built on Jan. 22, 2022, 1:01 p.m.