conditional_change: Change values conditionally

View source: R/subsetting.R

conditional_changeR Documentation

Change values conditionally

Description

Change values based on a condition given as a function.

Usage

conditional_change(x, func = NULL, func_str = NULL, new_value, handle_NA = T)

Arguments

x

(vector, data.frame, matrix or list) An object whose values to change.

func

(function) A function that returns a boolean.

func_str

(character scalar) A string to make a function from using math_to_function().

new_value

(scalar vector) A value to use in the cases.

handle_NA

(boolean) Whether to handle missing values.


Deleetdk/kirkegaard documentation built on April 22, 2024, 5:22 p.m.