You are on page 1of 4

BASE R GRAPHICS

par() defines global graphic parameters


with_par() temporary graphics parameters
mfrow Multiple Figure rows
Multi-frame Row-wise layout
cex character expansion can be global or local
pch point character, globe/local
pty = plot window sizing
“m” max spaced
“s” square plots
Plot type = explicitly local
type =
plot() Generic x-y plotting
x= the coordinates of points in the plot. Alternatively,
a plot methoda can
single
beplotting
provided.
structure, function or any R object with
y= the y coordinates of points in the plot, optional if x is an appropriate structure.
… Arguments to be passedfollowing
to methods,
arguments:
such as graphical parameters (see par). Many methods will accept the
type = what type of plot should be drawn. Possible types are
"p" for points,
"l" for lines
"b" for both
"c" for the lines part alone of "b"
"o" for both ‘overplotted’
"h" for ‘histogram’ like (or ‘high-density’) vertical lines
"s" for stair steps
"S" for other steps, see ‘Details’ below
"n" for no plotting
NOTE: plotting w/ type = ”n” allows you to frame the plot, then add to it with points()
lty =
All other types give a warning or an error; using, e.g., type = "punkte" = = "p" for S compatibility
Note that some methods, e.g.plot.factor, do not accept this.
main = an overall title for the plot: see title.

sub = a sub title for the plot: see title.


xlab = “title for the x axis”
xlim = limit for x axis ex: c(-100, 200)
ylab = “title for the y axis”
ylim = limit y axis ex: c(2500, 7500)
asp = the \(y/x\) aspect ratio, see plot.window.
log = rescale to a log axis ex: “x”, “y”
cex= character expansion (point size)
lwd = line width “#”
lty = line type “2” == “dashed”
pch = point character (1 – 25) symbols to choose from, as
pch =
well as alphabetic characters.
col = color of points
xpd = FALSE, restricts graph elements to the plot area
TRUE, allows clipping outside the plot region.

abline() This function adds one or more straight lines through the current plot.
a, b = the intercept and slope, single values.
untf = logical asking whether to untransform. See ‘Details’.
h= the y-value(s) for horizontal line(s).
v= the x-value(s) for vertical line(s).
coef = a vector of length two giving the intercept and slope.
reg = an object with a coef method. See ‘Details’.

text() draws the strings given in the vector labels at the coordinates given by x and y. y
x, y = numeric vectors of coordinates where the text labels should be written
labels = a character vector or expression specifying the text to be written
escape charactors \n work
adj = 0 left justified, 1 right justified
pos = a position specifier for the text. If specified this overrides any adj value given. Values of
3 above
2 left 4 right
1 below
offset when pos is specified, this value gives the offset of the label from the specified coordinate in fractions of a character width.
srt= string rotation % angle change. +/- 90 works best
cex =
col =
font = 1 - normal 2 – bold 3 – italics 4 – bold italics

legend() x= "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" ,"center"
y= optional if using coordinates numbers within the graph (requires trial/error
legend string or expression – c(“string”, “string”)
fill = color of boxes within the legend
border = border col
lty, lwd = has to be set up additional to your model shapes
pch = “c(#,#)” included lines
col = “c(“color”,”color”)”color of lines/shapes within the legend

axis() Used when axes = FALSE and you want to custom build an axis
side = 1 – x axis below,
2 – y axis left of plot
3 – x at top
4 – right
at = vector or seq for location of tic marks
labels = vector for labels at each tick mark
las = label axis style
1 – vertical, 2 – horizontal
col = axis / tick marks

supsmu() Friedman’s super smoother is a nonparametric regression estimator based on local linear regression with adaptive bandwidths.
Friedman [1984] proposed an oversmoothing parameter which biases the smooth towards the largest bandwidth from the grid
of bandwidths over which the cross-validation was performed.
returns an array for a Friedman smoothing spline
x= values for smoothing
y= y values for smoothing
wt = case weights, by default all equal
span = the fraction of the observations in the span of the running lines smoother, or "cv" to choose this by leave-one-out cross-validation.
bass = ∈ [0, 10] controls the smoothness of the fitted curve, w/ increasing smoothness.

corrplot() graphical display of a correlation matrix (correlogram),


reordering significance levels, confidence intervals, and algorithms for
x= works with cor(df) to create a corrMatrix to use as an x
method = Visualization Methods
"circle", "square", "ellipse", "number", "shade", "color", "pie"
type = layout types
"full" displays full correlation matrix
"upper" displays upper triangular of the correlation matrix
"lower" displays lower triangular of the correlation matrix

order = "AOE" angular order of the eigenvectors. It is calculated from the two largest eigenvalues of the correlation matrix
"FPC" first principal component order
“hclust" hierarchical clustering order, andbe"hclust.method"
used. for the agglomeration method to
"hclust.method" = "ward", "single", complete", "average", "mcquitty", "median”,"centroid”
addrect = #, rectangle draw based on the hclusters
"alphabet" alphabetical order.
c1.* color legend variables
pos = “n” none
“b” bottom
align “r” rifght
tl.* text legend variables
pos = “n” none
“d” diagonal
“td” top / diagonal
col = text label color
“black”
srt = text label string rotation
diag = FALSE sometimes necessary to “shut off” other values if you want the diagonal blank

Combining Significance Tests


Establish confid level function
EX: res1 <- cor.mtest(mtcars, conf.level = .95)
Pull in the function values and name sig.level
EX: corrplot(M, p.mat = res1$p, sig.level = .01)
insig = blank leaves values blank
"p-value” writes in p-values
ation.

You might also like