missing_to_zero: Transform Missing NA values to Zeros

Description Usage Arguments Value Source Examples

Description

Transform NA values to Zeros, which can be helpful in data cleaning for loss amounts

Usage

1

Arguments

df

a data frame or indicated column of the data frame (named list)

...

a character vector optionally supplied as a c(...) vector

Value

returns the column of interest with transformed missing NA values to 0

Source

http://stackoverflow.com/questions/2641653/pass-a-data-frame-column-name-to-a-function

Examples

1
2
df = data.frame("x" = 1:3, "missings" = rep(NA, 3))
df$missings <- missing_to_zero(df, "missings")

jasdumas/dumas documentation built on May 18, 2019, 4:49 p.m.