filterVars: Filter duplicate variables from findVars

View source: R/filtervars.r

filterVarsR Documentation

Filter duplicate variables from findVars

Description

Filter duplicate variables from findVars

Usage

filterVars(x, ...)

Arguments

x

Output from findVars().

...

Filter terms. The name corresponds to the variable name for which to remove duplicates. Each term is a named vector whose names correspond to columns in 'x'. The values provide patterns for the given column to match.

Details

findVars() may identify multiple variables with the same name. This function can be used to select among these duplicates.

Value

The subset of 'x' that satisfies the supplied filters or that were not provided a filter.

Examples

## Not run: 
varnames <- c("kz021","kz011b","ype9670", "c645a")
vars <- findVars(varnames)
vars <- subset(vars, subset=tolower(name) %in% varnames)
vars <- filterVars(vars, kz021=c(obj="^kz"), kz011b=c(obj="^cp", lab="Participant"), c645a=c(cat2="Quest")) 

## End(Not run)

explodecomputer/alspac documentation built on Feb. 16, 2024, 4:18 p.m.