Set global plot options
pm_options(
smooth.lwd = 1.35,
smooth.col = .ggblue,
smooth.lty = 2,
smooth.method = "loess",
scatter.size = 1.5,
scatter.col = "black",
scatter.alpha = 1,
density.lwd = 1.35,
density.col = .ggblue,
density.lty = 2,
hline.lwd = 1.35,
hline.col = "darkgrey",
hline.lty = 1,
abline.lwd = 1.35,
abline.col = "darkgrey",
abline.lty = 1,
histogram.fill = "black",
histogram.alpha = 0.6,
histogram.col = "white",
boxplot.fill = "white",
boxplot.alpha = 1,
boxplot.hline.lwd = 1,
boxplot.hline.lty = 2,
boxplot.hline.col = "black",
boxplot.outlier.shape = 19,
qq.col = .ggblue,
qq.alpha = 1,
qq.size = 1.35,
pairs.cor.size = 3,
pairs.cor.prefix = "corr\n",
pairs.cor.col = .ggblue,
pairs.cor.fontface = "bold",
pairs.cor.digits = 2,
pairs.cor.shown = TRUE,
axis.title.short = FALSE,
time.unit = "hr"
)
pm_opts
pm
An object of class pm_opts
(inherits from environment
) of length 43.
An object of class pm_opts
(inherits from environment
) of length 43.
line width for smoother
line color for smoother
line type for smoother
method to use for creating smoother
point size for scatter plot
character name of color for scatter plot
transparency for points in scatter plot
line width for density plot on histogram
line color for density plot on histogram
line type for density plot on histogram
line width for horizontal reference line; see layer_h()
and gh()
line color for horizontal reference line; see layer_h()
and gh()
line type for horizontal reference line; see layer_h()
and gh()
line width for diagonal reference line; see layer_a()
and ga()
line color for diagonal reference line; see layer_a()
and ga()
line type for diagonal reference line; see layer_a()
and ga()
fill color for histograms
alpha value for histograms
line color for histograms
fill color for histograms
alpha value for boxplots
line width for horizontal reference line
line type for horizontal reference line
line color for horizontal reference line
shape for outliers in boxplots
point color for qq plots
alpha value for qq plots
point size for qq plots
font size for correlation text in upper panels of pairs plots
prefix for correlation text in upper panels of pairs plots
color for correlation text in upper panels of pairs plots
font face for correlation text in upper panels of pairs plots
number of digits to show when reporting correlation in upper panels of pairs plots
if TRUE
, then report the number of non-missing
observations used to calculate correlation in upper panels of pairs plots
shorten standard axis titles
default time unit
pm()
and pm_opts()
both refer to the same environment.
Global options can
be set in the environment with pm$set(name = value)
. There is also
a .list
argument to pm$set
that allows you to pass in a named list of
options to set (e.g. pm$set(.list = list(smooth.col="red4"))
).
Values can be extracted with pm$get("name")
.
Because it is an environment, the $
operator can also be used to get and
set values (see examples).
Other methods in the environment include pm$as.list()
, pm$mget()
,
pm$reset()
. pm$self
refers to the environment itself. A list of
default settings can be obtained with pm$defaults
. Methods for the
pm_opts
object include: print.pm_opts, as.list.pm_opts,
$<-.pm_opts
.
pm$set(smooth.lwd = 2)
pm$smooth.lwd
#> [1] 2
pm$smooth.lwd <- 1.3
pm$smooth.lwd
#> [1] 1.3
pm$get("smooth.lwd")
#> [1] 1.3
pm$reset()
x <- pm$as.list()
if (FALSE) {
defs <- pm$defaults
defs$smooth.col <- "firebrick"
pm$set(.list = defs)
}