is_discrete: Check if covariates are discrete

Description Usage Arguments Details Value

View source: R/utils.R

Description

is_discrete checks if the specified covariates could be regarded as discrete variables.

Usage

1
is_discrete(X, X_reg)

Arguments

X

A data frame of covariates

X_reg

The vector of covariates that will stratify the analyses. These variables have to be categorical.

Details

Note that this function should be used with caution. It used

nrow(X)/nrow(unique(X[,X_reg,drop=FALSE]))>10

as an ad hoc criterion. It is not the same as is.discrete

Value

TRUE for discrete; FALSE otherwise.


zhenkewu/nplcm documentation built on May 4, 2019, 10:19 p.m.