remove_data_variables: Remove data variables

View source: R/filter_dataset.R

remove_data_variablesR Documentation

Remove data variables

Description

Removes x variables from a dataset.

Usage

remove_data_variables(dataset, variables.to.remove, by.index = FALSE)

Arguments

dataset

Dataset to modify.

variables.to.remove

Variables to remove.

by.index

Logical. If TRUE, variables.to.remove are indexes.

Value

A dataset object with the same structure as the input, where the selected rows of 'dataset$data' have been removed. If no matching variables are found, the input dataset is returned unchanged and a warning is issued.

Examples

data <- matrix(
  1:9,
  nrow = 3,
  dimnames = list(c("10", "20", "30"), c("s1", "s2", "s3"))
)
metadata <- data.frame(class = c("A", "B", "A"), row.names = c("s1", "s2", "s3"))
dataset <- list(data = data, metadata = metadata)
remove_data_variables(dataset, "20")


specmine documentation built on Aug. 5, 2026, 5:06 p.m.