nuke: Replace All Values in Data Frame

View source: R/nuke.R

nukeR Documentation

Replace All Values in Data Frame

Description

Replace All Values in Data Frame

Usage

nuke(
  data,
  nuke_value = NA,
  ash = 0,
  exact = TRUE,
  where = NULL,
  which_cols = colnames(data)
)

Arguments

data

The data frame to which you're replacing values.

nuke_value

The value you want to replace with ash.

ash

The value you want to replace nuke_value with.

exact

Logical indicating whether or not you want to use grepl(ignore.case = TRUE, perl = TRUE) style regex.

where

Filter applied to the data indicating the conditions required for the values to be replaced. Requires a string input, but functions the same way dplyr::filter does.

which_cols

The columns across which the replacements will be applied. Use this if some columns that don't contain nuke_value are returning as a different class than they were in the original data input

Value

A data frame with the all occurrences of nuke_value replaced with ash.

Examples

nuke(mtcars, 6, "IT WORKED AGAIN", where = "mpg == 21.0")
nuke(mtcars, 6)


EricLamphere/ezxfig documentation built on Jan. 29, 2023, 1:44 a.m.