View source: R/data_cleaners.R
single_value | R Documentation |
Missing values are replaced with the single value, and if all values are
missing, the first value in missing
is used throughout.
single_value(x, missing = NA, warn_if_all_missing = FALSE, info = NULL)
x |
The vector which should have a single value |
missing |
The vector of values to consider missing in |
warn_if_all_missing |
Generate a warning if all values are missing? |
info |
If more than one value is found, append this to the warning or error to assist with determining the location of the issue. |
x
as the scalar single value found throughout (or an error if
more than one value is found).
single_value(c(NA, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.