baytrends (version 1.1.0)

na2miss: Recode Data

Description

Converts missing values (NAs) to or from a user specified value. From smwrBase package.

Usage

na2miss(x, to = -99999)

miss2na(x, from = -99999)

Arguments

x

a vector. Missing values (NAs) are allowed.

to

the replacement value for NA.

from

the target value to match and replace with NA.

Value

An object like x with each target value replaced by the specified value.

Examples

Run this code
# NOT RUN {
## Construct simple substitutions
na2miss(c(1, 2, 3, NA, 5, 6))
# }

Run the code above in your browser using DataLab