remove_constants: Remove empty rows and columns and constant column

View source: R/remove_constants.R

remove_constantsR Documentation

Remove empty rows and columns and constant column

Description

Remove empty rows and columns and constant column

Usage

remove_constants(data, cutoff = 1L)

Arguments

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.

Value

The input dataset without the empty rows and columns and the constant columns.

Examples

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)

cleanepi documentation built on June 22, 2024, 9:48 a.m.