is.categorical: Determines if column(s) in the vector or data.frame is/are...

Description Usage Arguments Value Examples

View source: R/xwas.R

Description

Determines if column(s) in the vector or data.frame is/are categorical.

Usage

1
is.categorical(data, varname = NULL, lower = 1, upper = 11)

Arguments

data

is a data.frame or vector representing the data to be analyzed.

varname

is the name of a column of the data.frame to be determined if it is a categorical variable or not based on the number of factors. It can be evaluated singularly (if a string) or if it is a vector of strings an equal length vector will be returned. If data is a vector then this argument can be optional, if it is optional and a data.frame is provided for the input data then all columns will be evaluated.

lower

is a numeric to set the lower bound, number of unique entries is GREATER THAN this value. Default is 1 (at least 2+ uniques).

upper

is a numeric to set the upper bound, number of unique entries is LESS THAN this value. Default is 11 (less than 11 uniques).

Value

a vector indicating if the data vector or data.frame column(s) are likely categorical variables by the presence of more than 2 but less than 10 unique counts.

Examples

1
2
3
4
## Not run: 
is.categorical()

## End(Not run)

nampho2/xwas documentation built on May 23, 2019, 12:17 p.m.