Learn R Programming

playwith (version 0.9-32)

latticistCompose: Latticist API

Description

Convert a simple specification list into a Lattice plot call, or the inverse operation.

Usage

latticistCompose(dat, spec = alist(),
                 datArg = substitute(dat))

latticistParse(call, trellis = NULL)

Arguments

dat
a data frame (with numeric and/or categorical variables).
datArg
the symbol to use for dat in the generated call.
spec
a list specifying the latticist plot. See Details.
call
a call to a high-level lattice plot function.
trellis
the trellis object generated by call; optional.

Value

  • latticistCompose returns a call. latticistParse returns a list, in the same form as spec.

Details

Elements of spec can include: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] Note that xvar, yvar, zvar, groups, cond, cond2, subset must be language objects. The easiest way to specify them is to use the alist() structure, or equivalently to wrap each element in quote(); see examples.

References

For an excellent introduction to and coverage of Lattice: Sarkar, Deepayan (2008) "Lattice: Multivariate Data Visualization with R", Springer. http://lmdvr.r-forge.r-project.org/

See Also

latticist, Lattice

Examples

Run this code
latticistCompose(CO2)

latticistCompose(CO2, spec = alist(xvar = uptake))

latticistCompose(CO2, spec = alist(yvar = uptake))

latticistCompose(CO2, spec = alist(yvar = uptake, ydisc = TRUE))

latticistParse(quote(xyplot(conc ~ uptake | Type, CO2,
                            type = "p")))

Run the code above in your browser using DataLab