explode: Explode object

Description Usage Arguments Details Value See Also Examples

View source: R/explode.R

Description

Presents an R object in an exploded, or expanded, form

Usage

1
explode(x, indent = 2)

Arguments

x

an R oject, or a character string describing an R object

indent

how many spaces for indention (and exdention) at each level

Details

If x is an R oject it is first deparsed and converted into a character string describing the object. This string is then unwrapped, or exploded, according to these rules: newline and exdention after each open parenthesis, newline and indention after each close parenthesis, and newline after each comma. Parentheses and commas forming part of character strings are ignored.

Value

An exploded representation of the object is printed to console, and returned invisibly. The output is in most cases a complete and reproducible representation of the object, similarly to dput, but less compact and more reaviling of its inner structure.

See Also

dput, dput2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
xc <- 'list(v=1, A=c("abv", "bom"), B=c(1:3, 31, 28), list("foo", "bar", 1))'
explode(xc)

xl <- list(O=NA, R=list(j=1:3, h="(a)", q=structure(list(a=1:2, b=c("A, K",
  "B, L")), class="data.frame", row.names=c(NA, -2L))), N=1, L=FALSE)
explode(xl)

mt <- 'coplot(mpg ~ disp | as.factor(cyl), data = mtcars,
       panel = panel.smooth, rows = 1)'
explode(mt)

AkselA/R-ymse documentation built on March 21, 2020, 9:52 a.m.