View source: R/clean_timci_data.R
selective_replace | R Documentation |
This function replaces NA and 0 values in a specified column of a data frame with 1 if another corresponding column with the same name and a "1" suffix has a value of 1.
selective_replace(df, col, cols)
df |
A data frame. |
col |
A character string indicating the name of the column to replace. |
cols |
A character vector of column names to check for the existence of the 'col' column. |
The input data frame with specified column values replaced.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.