frenum_miss: Fast renumbering of missing id

Description Usage Arguments Value See Also Examples

Description

frenum_miss() will replace certain values with NA. For numeric vectors ids coded as 0 or -99 will be considered as missing or unknown. For character vectors this is extended to include '.', '*', 'NA' and ' '.

Usage

1

Arguments

id

a numeric or character vector for which the missing codes will be replaced with NA

Value

a numeric or character vector

See Also

renum_miss() which is the R implementation of the same

Examples

1
2
3
4
5
6
7
set.seed(42L)
ids <- rpois(50, 100)
ids[sample.int(50, 10)] <- c(0L, -99)[sample.int(2, 10, replace = TRUE)]
frenum_miss(ids)

ids <- c("A", "B", ".", "D", "*", "NA", " ", "  ", "K")
frenum_miss(ids)

tstev/pedr documentation built on May 11, 2019, 4:06 p.m.