remove_metadata_variables: Remove metadata variables

View source: R/filter_dataset.R

remove_metadata_variablesR Documentation

Remove metadata variables

Description

Removes metadata variables from a dataset.

Usage

remove_metadata_variables(dataset, variables.to.remove)

Arguments

dataset

Dataset to modify.

variables.to.remove

Metadata variables to remove.

Value

A dataset object with the same structure as the input, where the selected columns have been removed from 'dataset$metadata'. If no matching metadata fields are found, the dataset is returned unchanged and a warning is issued.

Examples

data <- matrix(
  1:6,
  nrow = 2,
  dimnames = list(c("x1", "x2"), c("s1", "s2", "s3"))
)
metadata <- data.frame(
  class = c("A", "B", "A"),
  batch = c(1, 1, 2),
  row.names = c("s1", "s2", "s3")
)
dataset <- list(data = data, metadata = metadata)
remove_metadata_variables(dataset, "batch")


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