inzpar {iNZightPlots} | R Documentation |
iNZight Plotting Parameters
Description
Plotting parameters for iNZight Plots
Usage
inzpar(..., .viridis = requireNamespace("viridis", quietly = TRUE))
Arguments
... |
If arguments are supplied, then these values are set. If left empty, then |
.viridis |
checks if the viridis package is installed; or can be turned off the default list is returned. |
Details
A whole suite of parameters that can be used to fine-tune plots obtained from the
iNZightPlot
function.
The parameters include both plot type, style, and appearance.
- 'pch'
the plotting symbol to be used; default is '21' (circle with fill)
- 'col.pt'
the colour of points. this can either be a single value, or a vector of colours if
colby
is specified- 'col.fun'
a function to use for colouring points, etc., or the name of a palette, see
inzpalette
- 'col.emph', 'col.emphn'
emphasize the chosen level of a colour by variable. For numeric colour by,
col.emphn
specifies the number of quantiles to use.- 'emph.on.top'
if
TRUE
, emphasised points will be positioned on top- 'col.default'
the default colour functions, containing a list with entries for 'cat' and 'cont' variables
- 'col.missing'
the colour for missing values; default is a light grey
- 'reverse.palette'
logical, if
TRUE
the palette will be reversed- 'col.method'
the method to use for colouring by a variable, one of 'linear' or 'rank'
- 'cex'
the overall scaling for the entire plot; values less than 1 will make the text and points smaller, while values larger than 1 will magnify everything
- 'cex.pt'
the scaling value for points
- 'cex.dotpt'
-
the scaling value for points in a dotplot. Note, this is not multiplicative with
'cex.pt'
- 'cex.lab'
the scaling value for the plot labels
- 'cex.axis'
the scaling value for the axis labels
- 'cex.main'
the scaling value for the main plot title
- 'cex.text'
the scaling value for text on the plot
- 'resize.method'
one of 'proportional' (default) or 'emphasize'
- 'alpha'
transparency setting for points; default is 1, 0 is fully transparent
- 'bg'
the background colour for the plot
- 'grid.lines'
logical to control drawing of axis grid lines
- 'col.grid'
if 'grid.lines' is
TRUE
, this controls the colour of them. The default is 'default', which will choose a colour based on the value of 'bg')- 'fill.pt'
the fill colour for points; default is
"transparent"
- 'lwd'
the line width of lines (for joining points)
- 'lty'
the line type of lines (for joining points)
- 'lwd.pt'
the line width used for points; default is 2
- 'col.line'
the colour of lines used to join points
- 'col.sub'
vector of up to two colours for the background of subplot labels. If only one specified, it is used for both.
- 'locate.col.def'
the default colour for locating points
- 'highlight.col'
colour to use for highlighting points
- 'jitter'
the axes to add jitter to. Takes values
"x"
,"y"
, or"xy"
(default is en empty string,""
)- 'rugs'
the axes to add rugs to. Takes same values as
jitter
- 'trend'
a vector containing the trend lines to add to the plot. Possible values are
c("linear", "quadratic", "cubic")
- 'smooth'
the smoothing (lowess) for the points. Takes a value between 0 and 1 (the default, 0, draws no smoother)
- 'smoothby.lty'
the line type used for smoothers if
trend.by = TRUE
- 'quant.smooth'
if quantile smoothers are desired, they can be specified here as either the quantiles to smooth over (e.g.,
c(0.25, 0.5, 0.75)
), or"default"
, which uses the sample size to decide on an appropriate set of quantile smoothers- 'LOE'
logical, if
TRUE
, then a 1-1 line of equality is drawn- 'join'
logical, if
TRUE
, then points are joined by lines- 'lines.by
logical, if
join = TRUE
andcolby
is specified, points are joined by the specified variable- 'col.trend'
a named list of colours to be used for drawing the lines. The default is
list(linear = "blue", quadratic = "red", cubic = "green4")
- 'lty.trend'
a named list of line types for various types of trend lines. The default is
list(linear = 1, quadratic = 2, cubic = 3)
- 'trend.by'
logical, if
TRUE
, then trend lines are drawn separately for each group specified bycolby
- 'trend.parallel'
logical, if
TRUE
, the trend lines by group are given the same slope; otherwise they are fit independently- 'col.smooth'
the colour of the smoother
- 'col.LOE'
the colour of the line of equality
- 'lty.LOE'
the line type of the line of equality
- 'boxplot'
logical, if
TRUE
, a boxplot is drawn with dotplots and histograms- 'box.lwd', 'box.col', 'box.fill'
the line width, colour, and fill colour for the box plot drawn
- 'bar.lwd', 'bar.col', 'bar.fill'
the line width, colour, and fill colour of bars in a bar plot
- 'bar.counts'
logical, if
TRUE
bar graphs will display counts instead of percentages (the default)- 'full.height'
may no longer be necessary ...
- 'inf.lwd.comp', 'inf.lwd.conf'
the line width of comparison and confidence intervals, respectively
- 'inf.col.comp', 'inf.col.conf'
the colour of comparison and confidence intervals, respectively. These take a length 2 vector, where the first element is used for normal inference, while the second is used for bootstrap intervals
- 'inference.type'
the type of inference added to the plot. Possible values are
c("comp", "conf")
- 'inference.par'
the parameter which we obtain intervals for. For a dotplot or histogram, this can be either
"mean"
or"median"
; for bar plots it can be "proportion"- 'ci.width'
the width of confidence intervals, default 0.95 for a 95% confidence interval
- 'bs.inference'
logical, if
TRUE
, then nonparametric bootstrap simulation is used to obtain the intervals- 'min.count'
the min count for barplots inference; counts less than this are ignored
- 'n.boot'
the number of bootstrap simulations to perform
- 'large.sample.size'
sample sizes over this value will use a large-sample plot variant (i.e., scatter plots will become hex plots, dot plots become histograms)
- 'largesample'
logical, if
TRUE
, then the large-sample plot variance is used- 'scatter.grid.bins'
the number, N, of bins to use for the scatter-grid plot, producing an N x N matrix
- 'hex.bins'
the number of bins to use for hexagonal binning
- 'hex.style'
the style of the hexagons, one of "size" or "alpha"
- 'hex.diffuse'
logical, Pass on rounding error to nearest not-yet-drawn hexes so that rare classes get represented
- 'hist.bins'
the number of bins to use for the histogram (The default
NULL
uses point size to approximate dot plot)- 'quant.cutoff'
if
quant.smooth = "default"
, these sample size values are used to determine which quantiles are drawn- 'plottype'
used to override the default plot type. Possible values, depending on data type, include
c("scatter"|"grid"|"hex"|"dot"|"hist")
- 'matchplots'
logical, if
TRUE
, then the type of plot is kept consistent between different subsets- 'match.limits'
a vector of two values used to decide whether to use all small-sample or all large-sample plots
- 'xlim'
a vector defining the x axis limits (default NULL will use the data)
- 'ylim'
a vector defining the y axis limits (default NULL will use the data)
- 'transform'
a list of variable transformations (e.g., list(x = 'log'))
- 'plot.features'
a list containing any additional features for new plots (e.g., maptype)
- 'round'
integer specifying optional rounding of numerical output, default NA (ignored)
- 'round_percent'
integer specifying rounding for percentages (default 2)
- 'signif'
integer specifying number of significant figured in numeric output (default 2). Ignored if
round
is not NA.
Value
an object of class inzpar.list
Examples
# arguments can be passed directly to \code{iNZightPlot}
iNZightPlot(Sepal.Length,
data = iris, col.pt = "red",
box.col = "blue", box.fill = "green"
)
# or stored and passed to it (only pars relevant to the current
# plot are used)
mypar <- inzpar(
col.pt = "red", box.col = "blue", box.fill = "green",
trend = "linear", trend.by = TRUE
)
inzplot(Sepal.Length ~ Species, data = iris, inzpar = mypar)
iNZightPlot(Sepal.Length, Sepal.Width,
data = iris, inzpar = mypar,
colby = Species
)