condition | R Documentation |
Facilitates producing a series of graphs conditioned by a grouping variable.
condition(plot.call, data, group, format = "grid", num.cols = NA, num.rows = NA, explanation = NULL, share = "", group.name = "", xtitle = "", ytitle = "", caption = "")
plot.call |
either a simple call to a graphics function or a sequence of calls enclosed in curly braces({}) |
data |
the data.frame containing the variables used in |
group |
a character string identifying the grouping variable in
|
format |
the orientation of the graphs. If "table," then the graphs are created beginning in the upper-left hand corner. If "grid," then the graphs are created beginning in the lower-left See Details. hand corner. |
num.cols |
the number of columns on each page. See Details. |
num.rows |
the number of rows on each page. See Details. |
explanation |
where to place an explanation if necessary. See
|
share |
character, if |
group.name |
a character string to prepend to each value in
|
xtitle |
the x-axis title (also called x-axis caption). |
ytitle |
the y-axis title (also called y-axis caption). |
caption |
the figure caption. |
Graphs are created by executing plot.call
for each unique value in
the variable specified by group
. The columns and rows are set by
num.cols
and num.rows
. If both are set to missing NA
,
then each page contains 1 graph, and the graphics setup should provide for
mulitple pages. If one of num.cols
or num.rows
is set to a
numeric value, the other is calculated from the number of graphs so that all
graphs would be displayed on a single page. If both num.cols
and
num.rows
are set to numeric values, then each page would contain a
maximum of num.cols
times num.rows
and multiple pages would be
needed if that were less than the total number of graphs.
The order of the graphs is controlled by the type of group
. If
group
is a factor, then the order is set by the order of the levels,
otherwise the order is set by the order from unique
.
The value returned by plot.call
is returned invisibly. If
used correctly, it could be used to add an explanation.
This function is designed to facilitate the production of conditioned
graphs, but may not render each collection completely. For example, graphs
arranged in table format will not have x-axis labels for incomplete
columns.
A call must be made to setPage
or setPDF
to set up the
graphics page before calling condition
. The returned value can be
used to create an explanation, if desired. If explanation
is not
NULL
, then the graph is set to the explanation and there is no need
to call setGraph
to set up the explanation.
The called plotting function must set the margin
argument to
.margin
. See the demos for examples.
Cleveland, W.S., 1993, Visualizing data: Summit, New Jersey, Hobart Press, 360 p.
setLayout
, setPage
,
setPDF
, unique
## Not run: # See for examples of condition: demo(topic="Coplot-complexScatterPlot", package="smwrGraphs") demo(topic="Coplot-simpleBoxPlot", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.