varcontain: varcontain

Description Usage Arguments Examples

View source: R/varcontain.R

Description

This function returns any variable names in a given data set that contain the a provided string.

Usage

1
varcontain(df, matching = "all", except = "none", ignorecase = TRUE)

Arguments

df

A dataframe

matching

A string that the returned variables in the dataframe will contain

except

A string that the returned variables in the dataframe will NOT contain

ignorecase

Ignore case of the string? Default is TRUE

Examples

1
2
3
tdf <- data.frame(x=4,t=6,e=2,b=4,yep=9,Nope=10,cort1=3,cort4=5,Cort_55=9)
varcontain(tdf,'cort')
[1] "cort1"   "cort4"   "Cort_55"

fiksdala/fiksdal documentation built on Jan. 9, 2022, 10:54 p.m.