fill: Replace values with something else

Description Usage Arguments Value Author(s) Examples

View source: R/helpers.r

Description

Replace values with something else

Usage

1
2
3
fill(x, pattern, replacement, invert = FALSE)

na_fill(x, replacement)

Arguments

x

Variable containing NAs.

pattern

The values in x to be replaced. Can also be a function.

replacement

The value which is to replace the values matching pattern.

invert

Whether to fill all values except the ones matching pattern.

Value

An imputed version of x.

Author(s)

Christofer Bäcklin

Examples

1
2
fill(1:10, function(x) x %% 2 == 1, 0)
na_fill(c(1,2,NA,4,5), 3)

emil documentation built on Aug. 1, 2018, 1:03 a.m.

Related to fill in emil...