Learn R Programming

repfun (version 0.1.2)

ru_fillna: Fill NA values with specified values or zeros/blanks by default.

Description

Pass in a data frame along with a vector of variables and a vector of fill values. (Default fill is 0 for numeric and blank " " for character.)

Usage

ru_fillna(dsetin, vars = NULL, fills = NULL)

Value

The incoming data frame with the requested NA values replaced.

Arguments

dsetin

Incoming data frame to have labels added to columns.

vars

Vector of variables to replace NA values.

fills

Vector of fill values.

Examples

Run this code
library(repfun)
repfun::ru_fillna(airquality, vars=c('Ozone','Solar.R'), fills=c(1111,2222)) %>% head(10)

Run the code above in your browser using DataLab