conditional_change | R Documentation |
Change values based on a condition given as a function.
conditional_change(x, func = NULL, func_str = NULL, new_value, handle_NA = T)
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. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.