recode_threat: Convert threats from text to codes used in database

recode_threatR Documentation

Convert threats from text to codes used in database

Description

If a range of threat levels is given then the average of the two threat codes is used. E.g. a threat level of "Extreme - Moderate (11-100%)" would get a code of 4 which is the average of 3 (Moderate) and 5 (Extreme).

Usage

recode_threat(x, var, threat_code = threat_code)

Arguments

x

A character vector with the threat level

var

which threat component is being converted

threat_code

A data.frame with corresponding threat levels and codes

Value

a data.frame


see24/CANSARD documentation built on Sept. 28, 2024, 6:30 a.m.