R/misc.R

Defines functions formatText

#' @importFrom utils capture.output
formatText <- function(text, n = 20L, truncated = "<...>") {

  result <- if (nchar(text) < n)
    text
  else
    paste(text, truncated)

  encodeString(result)
}

Try the rstudioapi package in your browser

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

rstudioapi documentation built on Oct. 23, 2024, 1:07 a.m.