R/label_wrap_mod.r

#' Wrap label text.
#' 
#' @param value vector (converted using \code{\link{as.character}}) to be wrapped.
#' @param width the maximum width of each line in characters.
#' 
#' Adapted from https://github.com/hadley/ggplot2/wiki/labeller
label_wrap_mod <- function(value, width = 25) {
  sapply(strwrap(as.character(value), width=width, simplify=FALSE), 
         paste, collapse="\n")
}

Try the likert package in your browser

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

likert documentation built on May 2, 2019, 11:11 a.m.