R/cat_cont.R

Defines functions cat_cont

Documented in cat_cont

#' @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" )

Try the catcont package in your browser

Any scripts or data that you put into this service are public.

catcont documentation built on May 1, 2019, 6:42 p.m.