makeNA: Make NA

Description Usage Arguments Details Value Examples

Description

Examine a dataset for numeric values outside of a desired range. Bad values will be replaced with NAs.

Usage

1
  makeNA(data, mins, maxs)

Arguments

data

data.frame. Dataset with numerical values to range check.

mins

named numeric vector. Minimum value for each named column.

maxs

named numeric vector. Maximum value for each named column.

Details

mins and maxs should be named vectors, where the names are columns found in data. They should contain the same names and have the same length.

Value

Returns modified data.frame invisibly.

Examples

1
2
3
set.seed(100)
df <- data.frame(x=rnorm(100), y=rnorm(100, sd=0.5))
na.df <- makeNA(df, c(x=-2,y=-1), c(x=2,y=1))

harrelfe/rreport documentation built on May 17, 2019, 2:48 p.m.