checkCharVec: Checking if all elements of a list are all character vectors

Description Usage Arguments Value Examples

View source: R/checkFuncs.R

Description

Checking if all elements of a list are all character vectors

Usage

1
checkCharVec(listChar, namesListElements = NULL)

Arguments

listChar

A list of the vectors of which one wishes to check if their data type is character

namesListElements

Character vector containing the names of the variables of which the data type is checked. Optional parameter, with as default value NULL. This argument should be used when the variable of which the data type is checked is not an object that was provided as an argument to the function, or when the list elements of the first argument do not have a name attached to it.

Value

No value is returned if all vectors have the character data type. If not, an error message is thrown for each element of the list that does not pertain to the character data type.

Examples

1
2
3
4
5
6
7
8
arg1 <- 'something'
checkCharVec(list(arg1))

checkCharVec(list('somethingElse', TRUE))

arg2 <- 2
checkCharVec(list(arg2))
checkCharVec(list(arg2, TRUE, 5L))

devFunc documentation built on May 1, 2019, 11:32 p.m.