checkAlias: Check for alias structures in a dataframe, and throw an error...

View source: R/F_checkAlias.R

checkAliasR Documentation

Check for alias structures in a dataframe, and throw an error when one is found

Description

Check for alias structures in a dataframe, and throw an error when one is found

Usage

checkAlias(datFrame, covariatesNames)

Arguments

datFrame

the data frame to be checked for alias structure

covariatesNames

The names of the variables to be considered

Value

Throws an error when an alias structure is detected, returns invisible otherwise

Examples

#Make a dataframe with aliased variables
df = data.frame(foo = rnorm(10), baa = rep(c(TRUE, FALSE), each = 5),
foo2 = factor(rep(c("male", "female"), each = 5)))
checkAlias(df, c("foo", "baa"))
#Check test files for the error being thrown

CenterForStatistics-UGent/RCM documentation built on April 24, 2023, 8:26 p.m.