na_replace {manymodelr} | R Documentation |
Replace missing values
Description
Replace missing values
Usage
na_replace(df, how = NULL, value = NULL)
Arguments
df |
The data set(data.frame or vector) for which replacements are required |
how |
How should missing values be replaced? One of ffill, samples,value or any other known method e.g mean, median, max ,min. The default is NULL meaning no imputation is done. For character vectors, the use of 'get_mode' is also supported. No implementation for class factor(yet). |
value |
If how is set to value, this allows the user to provide a specific fill value for the NAs. |
Details
This function currently does not support grouping although this may be achieved with some inaccuracies using grouping functions from other packages.
Value
A data.frame object with missing values replaced.
Examples
head(na_replace(airquality,how="value", value="Missing"))
[Package manymodelr version 0.3.7 Index]