| dry_run | R Documentation |
Simulates the effect of one or more preprocessing steps on a dataset and returns a report describing which variables would be removed, how many observations might be deleted, and other changes. The input data are not altered.
dry_run(data, steps = c("varidele", "obsedele", "outlier"),
cols = NULL, group = NULL, date_col = NULL,
fraction = 0.25, top = 0.995, bottom = 0.0025,
by = "min", half = 30, method_outlier = "iqr", coef = 1.5,
verbose = FALSE)
data |
A data frame to be simulated. |
steps |
Character vector of steps to simulate. Currently supported: |
cols |
Column indices or names of numeric variables to consider. If |
group |
Optional grouping column for outlier detection. |
date_col |
Optional time column for observation deletion. |
fraction |
Missing fraction threshold for variable deletion. |
top |
Top percentile for outlier detection (percentile method). |
bottom |
Bottom percentile for outlier detection (percentile method). |
by |
Time unit for consecutive missing deletion (see |
half |
Half window size in minutes for consecutive missing deletion. |
method_outlier |
Outlier detection method: |
coef |
Coefficient for IQR or MAD outlier detection. |
verbose |
Logical; if |
This function is useful for understanding the potential impact of preprocessing without changing the dataset. It actually runs varidele, obsedele, and detect_outliers on a copy of the input, and returns precise per-step before/after counts. The caller's data frame is never modified.
A list with the following components:
original_n: number of rows in the original data.
original_ncol: number of columns in the original data.
varidele: a list containing removed column names and count (if step included).
obsedele: a list with rows_before, rows_after, and removed.
outlier: a list with na_before, na_after, and added.
final_n: number of rows remaining after simulation, reflecting both variable deletion and observation deletion.
final_ncol: number of columns remaining after simulation.
dry_run(data[1:200, c(1, 4, 17:19)], cols = 3:5, steps = c("varidele", "obsedele", "outlier"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.