View source: R/impute_missing.R
| impute_missing | R Documentation |
Impute missing values
impute_missing(
data,
cols = NULL,
method = "linear",
group = NULL,
date_col = NULL,
max_gap = NULL,
verbose = FALSE
)
data |
A data frame or matrix. |
cols |
Columns to impute. If |
method |
"linear", "locf", "nocb", "mean", or "median". |
group |
Optional grouping column. |
date_col |
Time column. |
max_gap |
Not implemented; ignored with a warning. |
verbose |
Logical. |
A data frame with imputed values.
1. Example data is from https://smear.avaa.csc.fi/download. It includes particle number concentrations in SMEAR I Varrio forest.
impute_missing(data[1:100, c(1, 4, 17:19)], cols = 3:5, method = "locf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.