burst | R Documentation |
Splits a (numeric/logical/character) vector, matrix, data.frame or a list of such into a list of columns, with corresponding group and variable information as well as labels. This is an auxiliary function for checking and converting the data argument of zenplot().
burst(x, labs = list())
x |
A |
labs |
Either
If any of these components is not given, it is set to the defaults as described in
|
A list
with components
xcols
- a list containing the column vectors of x
groups
- the group number for each column of x
vars
- the variable number (within each group) for each column of x
glabs
- the group label for each column of x
labs
- the group and variable labels for each column of x
Performance critical
Marius Hofert
Other tools for constructing your own plot1d and plot2d functions:
burst_aux()
,
check_zargs()
,
extract_1d()
,
extract_2d()
,
plot_indices()
## Unnamed list of (some named, some unnamed) valid components
A <- matrix(1:12, ncol = 3)
x <- list(A, 1:4, as.data.frame(A))
burst(x, labs = list(group = "G", var = "V", sep = ", "))
burst(x) # the same defaults as above
burst(x, labs = list(sep = " ")) # only changing the separator
## Note: - No group labels are given in 'x' and thus they are constructed
## in the above call
## - The variable names are only constructed if not given
burst(x, labs = list(group = ""))
burst(x, labs = list(group = NULL, group2d = TRUE)) # no group labels
## Note: There's no effect of 'group2d = TRUE' visible here as
## 'x' doesn't contain group labels
burst(x, labs = list(group = NULL)) # no group labels unless groups change
burst(x, labs = list(var = NULL)) # no variable labels
burst(x, labs = list(group = NULL, var = NULL)) # neither one
burst(x, labs = NULL) # similarly, without any labels at all
## Named list
x <- list(mat = A, vec = 1:4, df = as.data.frame(A))
burst(x)
## Note: - The given group labels are used
## - The variable names are only constructed if not given
burst(x, labs = list(group = NULL, group2d = TRUE)) # no group labels
burst(x, labs = list(group = NULL)) # no group labels unless groups change
## Note: Now the effect of 'group2d' is visible.
## Partially named list
x <- list(mat = A, vec = 1:4, as.data.frame(A))
burst(x)
burst(x, labs = list(group = NULL, group2d = TRUE)) # no group labels
burst(x, labs = list(group = NULL)) # no group labels unless groups change
burst(x, labs = list(var = NULL)) # no variable labels
burst(x, labs = list(group = NULL, var = NULL)) # only group labels and only if groups change
burst(x, labs = NULL) # neither group nor variable labels
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.