Learn R Programming

zenplots (version 0.0-1)

extract: Extracting Information from Zen Arguments

Description

Auxiliary functions to extract information from zargs for 1d and 2d (default) plots.

Usage

extract_1d(zargs)
extract_2d(zargs)

Arguments

zargs

argument list as passed from zenplot(). This must at least contain x, orientations, vars, num, lim and labs (for extract_1d()) and x, vars, num, lim and labs (for extract_2d()); see zenplot() for an explanation of these variables.

Value

for extract_1d():

list with the data to be plotted in the 1d plot (x), a list with all columns of x (xcols), the group numbers for each column of x (groups), the variable numbers for each column of x (vars), the group labels for each column of x (glabs), the variable labels for each column of x (vlabs), a logical indicating whether the plot is horizontal or vertical (horizontal) and the axis limits (xlim).

for extract_2d():

list with the data to be plotted in the 2d plot (x and y), a list with all columns of x (xcols), the group numbers for each column of x (groups), the variable numbers for each column of x (vars), the group labels for each column of x (glabs), the variable labels for each column of x (vlabs), the x-axis and y-axis limits (xlim and ylim) and a logical indicating whether the x and y variables belong to the same group (same.group).

Details

This is an auxiliary function used by the provided 1d and 2d plots. For performance reasons, no checking of the input object is done.

See Also

plots_graphics, plots_grid

Examples

Run this code
# NOT RUN {
## Dummy example (mimicking how zargs are built internally)
set.seed(271)
n <- 100
x <- list(matrix(rnorm(n*2), ncol = 2), matrix(rnorm(n*3), ncol = 3))
n2dplots <- 5 - 1
pathLayout <- unfold(n2dplots)
path <- pathLayout$path
Layout <- pathLayout$layout
zargs2d <- list(x = x,
                turns = path$turns,
                orientations = Layout$orientations,
                vars = Layout$vars,
                lim = "individual",
                labs = list(group = "G", var = "V", sep = " "),
                width1d = 1,
                width2d = 10,
                num = 2,
                ispace = 0)

## Calling extract_2d()
str(extract_2d(zargs2d))
# }

Run the code above in your browser using DataLab