R/cat_cont.R

#' @return
#'
#' `cat_cont` returns a named character with values either "`cat`" or "`cont`".
#' If `x` is a atomic vector, a single string is given. If `x` is recursive,
#' a "`cat`"/"`cont`" value is given for each element. Names correspond to the
#' names of the element.
#'
#' @examples
#'
#'   data(iris)
#'   cat_cont(iris)
#'
#' @md
#' @rdname catcont
#' @export

cat_cont <- function(x)
  if( is.recursive(x) )
    ifelse( sapply(x, is_cat), "cat", "cont" ) else
    ifelse( is_cat(x), "cat", "cont" )
decisionpatterns/catcont documentation built on May 15, 2019, 5:35 p.m.