print.structured {stripless} | R Documentation |
Methods for structured objects.
Description
Print/plot and summary methods for class "structured"
objects.
plot and print methods are the same for "structured"
objects
Summary method for "structured"
objects.
Print method for "summary.structured"
objects.
Usage
## S3 method for class 'structured'
print(x, legendLoc = c("left", "right", "top", "bottom",
"newpage"), legend = defaultStrucLegend, lbl = "PLOT STRUCTURE",
abbrevLength = c(0, 0), ...)
## S3 method for class 'structured'
plot(x, legendLoc = c("left", "right", "top", "bottom",
"newpage"), legend = defaultStrucLegend, lbl = "PLOT STRUCTURE",
abbrevLength = c(0, 0), ...)
## S3 method for class 'structured'
summary(object, ...)
## S3 method for class 'summary.structured'
print(x, lbl = "PLOT STRUCTURE", ...)
Arguments
x , object |
The object to be displayed or summarized. |
legendLoc |
An optional location of a legend describing the plot layout to be used
as a legend on the trellis plot. Note that a text legend is always printed on
the console. If used, this argument specified the position of a legend in the trellis
display. It must be one of If |
legend |
A function that constructs a grob to use as a plot legend. It must
accept at least 3 arguments named The default is the |
lbl |
Label for console legend. Default = "PLOT STRUCTURE" |
abbrevLength |
Default = |
... |
Further arguments to pass down to either the |
Details
The print
and plot
methods produce a plot and informative legend
for "structured"
objects. The plot
method is an alias for the print
method. The summary
method gives a simple summary of the object with a
print
Note
Do not use the packet.panel
argument of print.trellis
, as this will
totally mess up the display.
See Also
print.trellis, defaultStrucLegend
Examples
require(datasets)
# quakes data
#
# Create and save plot
out <- strucplot(lat ~ long|cut(mag,5)*cut(depth,4), data = quakes,
col="blue", main = "Earthquake locations, by magnitude and depth")
# Summary:
summary(out)
# Default output -- structure legend on console only
print(out)
# Add legends to the plot on either right or bottom (note partial matching)
print(out, legendLoc = "right")
print(out, legendLoc = "b")
#
# Plot the legend by itself on a separate page
print(out, legendLoc = "newp")
#
# Extra grid "gp" arguments to alter text appearance
print(out, legendLoc = "b",col="blue",fontface = "italic", abbrev = 5)
#
# ******* Using the "abbrev" argument with the 'barley' data set ****
#
out <- strucplot(variety~yield|year*site,data=barley, horizontal=TRUE,
panel=panel.dotplot, col = "darkblue", scales = list(alternat = 1,
y = list(cex=.5)), spacings = list(x=0, y=.5))
# Default
print(out)
#
# Abbreviate factor names and levels
print(out, abbrev = c(3,4))
#
# abbreviate just the levels of 'site' and change the console legend title
print(out, abbrev = list(site = c(0,4)), lbl = "Structure Key")
#
# Note that the 'abbreviate' argument is shared by console and plot
# legends; as are the optional 'heading' and 'miss' arguments
# by the 'defaultStrucLegend' function.
print(out,abbrev = list(site = c(0,4)),legendLoc="t",
heading = c("Left-Right", "Up-Down"))