Select Variables Based on Column Design
Source:R/all_generic.R, R/hyperdesign.R, R/multidesign.R
select_variables.RdSubsets the columns (variables) of an object based on conditions applied to the column design metadata. This allows filtering variables by their properties (e.g., region, type, hemisphere) using dplyr-style filter expressions.
Usage
select_variables(x, ...)
# S3 method for class 'hyperdesign'
select_variables(x, ...)
# S3 method for class 'multidesign'
select_variables(x, ...)See also
column_design for extracting column metadata,
multidesign for creating multidesign objects
Examples
X <- matrix(rnorm(20*10), 20, 10)
Y <- data.frame(condition = rep(c("A", "B"), each=10))
col_info <- data.frame(
region = rep(c("frontal", "parietal"), 5),
hemisphere = rep(c("left", "right"), each=5)
)
mds <- multidesign(X, Y, col_info)
# Select only frontal variables
mds_frontal <- select_variables(mds, region == "frontal")