varidele: Delete variables containing too many missing values

View source: R/varidele.R

varideleR Documentation

Delete variables containing too many missing values

Description

Removes any numeric column whose missing value proportion exceeds a given threshold.

Usage

varidele(data, cols = NULL, fraction = 0.25, verbose = FALSE)

Arguments

data

A data frame or matrix containing numeric columns.

cols

Column indices or names of the numeric columns to consider. If NULL, all columns are used.

fraction

Missing proportion threshold. Columns with a missing fraction >= fraction are deleted. Default 0.25.

verbose

Logical; if TRUE, prints timing and deleted variables.

Details

The missing fraction is computed after excluding rows where all selected variables are NA. Any column whose missing fraction reaches the threshold is removed, regardless of its position in the selected block.

Value

A data frame with the retained columns.

Author(s)

Chun-Sheng Liang <chun-shengliang@qq.com>

References

1. Example data is from https://smear.avaa.csc.fi/download. It includes particle number concentrations in SMEAR I Varrio forest.

Examples

varidele(data, cols = 5:65)

dataprep documentation built on Oct. 1, 2026, 5:07 p.m.