baytrends (version 2.0.11)

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)

Value

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

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.

Examples

Run this code

## Construct simple substitutions
na2miss(c(1, 2, 3, NA, 5, 6))

Run the code above in your browser using DataLab