Learn R Programming

pkgmaker (version 0.10.1)

str_out: Formatting Utilities

Description

str_out formats character vectors for use in show methods or error/warning messages.

str_desc builds formatted string from a list of complex values.

str_fun extracts and formats a function signature. It typically formats the output capture.output(args(object)).

Usage

str_out(x, max = 3L, quote = is.character(x),
    use.names = FALSE, sep = ", ")

str_desc(object, exdent = 0L)

str_fun(object)

Arguments

x
character vector
max
maximum number of values to appear in the list. If x has more elements than max, a "..." suffix is appended.
quote
a logical indicating whether the values should be quoted with single quotes (defaults) or not.
use.names
a logical indicating whether names should be added to the list as NAME=VAL, ... or not (default).
sep
separator character
object
an R object
exdent
extra indentation passed to str_wrap, and used if the output should spread over more than one lines.

Value

  • a single character string

Examples

Run this code
x <- letters[1:10]
str_out(x)
str_out(x, 8)
str_out(x, Inf)
str_out(x, quote=FALSE)
str_fun(install.packages)

Run the code above in your browser using DataLab