Last chance! 50% off unlimited learning
Sale ends in
set
, theme
Each graph is based on a default color theme. The original default is colors="dodgerblue"
, but global
allows other color palettes to be set as default as well. Setting ghost=TRUE
provides transparency effects against a black background. Other system settings are also available.global(colors=c("blue", "gray", "rose", "green", "gold", "red", "darkred",
"dodgerblue", "purple", "sienna", "brown", "orange.black",
"gray.black", "white"), fill.bar=NULL, fill.pt=NULL,
trans=NULL, trans.fill.bar=NULL, trans.fill.pt=NULL,
stroke.bar=NULL, stroke.pt=NULL,
se.fill=NULL, fill.ellipse=NULL,
bg=NULL, grid=NULL, box=NULL,
heat=NULL, ghost=NULL,
n.cat=getOption("n.cat"), lab.size=getOption("lab.size"),
suggest=getOption("suggest"),
quiet=getOption("quiet"), brief=getOption("brief"),
results=getOption("results"), explain=getOption("explain"),
interpret=getOption("interpret"), document=getOption("document"),
code=getOption("code"),
width=120, show=FALSE)
theme(…)
set(…)
"black"
.TRUE
, add a black background, transparent grid lines
and transparency for the bars. Overrides individual settings for
those values. Setting to FALSE
has no effect.ScatterPlot
and
SummaryStats
, and also to the functions such as
Histogram
when processing multiple graphs.TRUE
, then provide suggestions for alternative analyses.TRUE
then some functions suppress console output.TRUE
, reduced text output.options
statement, as well as the transparency of plotted bars and points. Each time colors
is reset, the specific color options are reset to their default values, which includes a transparency fill for plotted points of 0.66. The gray color scheme is based on the colors used in Hadley Wickham's ggplot2
package. Set ghost=TRUE
is equivalent to setting bg
to "black"
and grid
to "transparent"
with a bar transparency of 0.7. It overrides these settings individually, so must turn ghost=FALSE
and set each of the three settings individually to change from the standard ghost
settings.options
.# set all subsequent graphic output to gray scale
global(colors="gray")
# define a custom color theme: sienna
# this works regardless of the set color theme because
# all of the individual components of the theme are changed
# the trans options are the default values, so not necessary to
# set unless already changed previously
# the three ghost settings - trans.fill.bar, grid and bg --
# must be manually entered to achieve a ghost plot
global(fill.bar="seagreen3")
global(fill.pt="seagreen3")
global(stroke.bar="seagreen4")
global(stroke.pt="seagreen4")
global(bg="seashell1")
global(grid="seashell2")
global(trans.fill.bar=.00)
global(trans.fill.pt=.66)
# all numeric variables with 8 or less unique values and equally spaced
# intervals are analyzed as categorical variables
global(n.cat=8)
Run the code above in your browser using DataLab