View source: R/remove_constants.R
remove_constants | R Documentation |
Remove empty rows and columns and constant column
remove_constants(data, cutoff = 1L)
data |
The input data frame or linelist |
cutoff |
The cut-off for empty rows and columns removal. If provided, only rows and columns where the percent of missing data is greater than this cut-off will removed. |
The input dataset without the empty rows and columns and the constant columns.
data <- readRDS(system.file("extdata", "test_df.RDS", package = "cleanepi"))
# introduce an empty column
data$empty_column <- NA
# remove the constant columns, empty rows and columns
dat <- remove_constants(
data = data,
cutoff = 1
)
# check the report to see what has happened
report <- attr(dat, "report")
summary(report)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.