Learn R Programming

loon (version 1.4.3)

loonFacets: A helper function that produces facetted plots at the time of constructing a loon plot.

Description

Facets across multiple panels can be created from an existing loonplot via l_facet or directly at the time of the original loon plot call (without constructing the unfacetted loon plot itself). loonFacets is that helper function called by the various loon plot creation function (e.g., l_plot, l_hist, etc.). at the time of their creation to produce the facets. It should rarely be called directly by the user.

The function makes use of the general loonPlotFactory interface to tcl.

For detailed information on its common arguments, see the arguments of l_facet or those of the loon plot constructor (e.g., l_plot, etc.)

Usage

loonFacets(
  type,
  by,
  args,
  on,
  bySubstitute,
  layout = "grid",
  connectedScales = "both",
  byArgs,
  linkingGroup,
  sync,
  parent,
  factory_tclcmd,
  factory_path,
  factory_window_title,
  xlabel = "",
  ylabel = "",
  title = "",
  modifiedLinkedStates = character(0L),
  ...
)

Arguments

type

the class name of the loon plot

by

loon plot can be separated by some variables into mutiple panels. This argument can take a vector, a list of same lengths or a data.frame as input.

args

named list of N-dimensional arguments (e.g., x, y, selected, etc.)

on

if the by is a formula, an optional data frame containing the variables in the by. If variables in by is not found in data, the variables are taken from environment(formula), typically the environment from which the function is called.

bySubstitute

effectively a call of substitute(by) on the by arguments used to generate warnings or errors.

layout

layout facets as 'grid', 'wrap' or 'separate'

connectedScales

Determines how the scales of the facets are to be connected depending on which layout is used. For each value of layout, the scales are connected as follows:

  • layout = "wrap": Across all facets, when connectedScales is

    • "x", then only the "x" scales are connected

    • "y", then only the "y" scales are connected

    • "both", both "x" and "y" scales are connected

    • "none", neither "x" nor "y" scales are connected. For any other value, only the "y" scale is connected.

  • layout = "grid": Across all facets, when connectedScales is

    • "cross", then only the scales in the same row and the same column are connected

    • "row", then both "x" and "y" scales of facets in the same row are connected

    • "column", then both "x" and "y" scales of facets in the same column are connected

    • "x", then all of the "x" scales are connected (regardless of column)

    • "y", then all of the "y" scales are connected (regardless of row)

    • "both", both "x" and "y" scales are connected in all facets

    • "none", neither "x" nor "y" scales are connected in any facets.

byArgs

further arguments to be used in determining how by will be used.

linkingGroup

the string naming the group of plots to be linked to the facets.

sync

string identifying how to synchronize the aesthetics with linked plots (i.e., "push" or "pull", "pull" by default).

parent

the parent loon widget

factory_tclcmd

the tcl command to be given to loonPlotFactory. For example, the loon histogram tcl command is the string '::loon::histogram'

factory_path

the tcl path given to loonPlotFactory to identify the widgets; for example, the string 'hist' to prefix histograms.

factory_window_title

the window title to be given to loonPlotFactory to better identify the window for the user; for example, the string 'loon histogram'.

xlabel

string to label the x direction of the facets

ylabel

string to label the y direction of the facets

title

string providing a title for the collection of facets

modifiedLinkedStates

states of the plot to be synchronized with plots in the same linking group. Used with sync = "push".

...

named arguments to modify the `loon` widget states

See Also

l_facet and, for example, l_plot, l_hist, l_serialaxes