sp
is an abbreviation for
scatterplot
.scatterplot(x, ...)
## S3 method for class 'formula':
scatterplot(formula, data, xlab, ylab, legend.title, subset, labels=FALSE, ...)
## S3 method for class 'default':
scatterplot(x, y, smooth=TRUE, span=0.5, reg.line=lm,
boxplots="xy", xlab=deparse(substitute(x)), ylab=deparse(substitute(y)),
las=par('las'), lwd=1, labels=FALSE, log="", jitter=list(), xlim=NULL, ylim=NULL,
cex=par("cex"), cex.axis=par("cex.axis"), cex.lab=par("cex.lab"),
cex.main=par("cex.main"), cex.sub=par("cex.sub"),
groups=FALSE, by.groups=!(groups[1]==FALSE), legend.title=deparse(substitute(groups)),
ellipse=FALSE, levels=c(.5, .9), robust=FALSE,
col=palette(), pch=1:n.groups, legend.plot=length(levels(groups)) > 1,
reset.par=TRUE, ...)
sp(...)
y ~ x
or
(to plot by groups) y ~ x | z
, where z
evaluates to a factor
or other variable dividing the data into groups.TRUE
a lowess nonparametric regression line is
drawn on the plot.FALSE
not to plot a regression line."x"
a boxplot for x
is drawn above the plot;
if "y"
a boxplot for y
is drawn to the right of the plot;
if "xy"
both boxplots are drawn.0
, ticks labels are drawn parallel to the
axis; set to 1
for horizontal labels (see par
).FALSE
a vector of point labels, to be used interactively
to identify points on the plot.log
argument to plot
, to produce log axes.x
or y
or both, specifying jitter factors
for the horizontal and vertical coordinates of the points in the scatterplot. The
jitter
function is usNULL
, determined from the data.NULL
, determined from the data.TRUE
, regression lines are fit by groups.TRUE
data-concentration ellipses are plotted.c(.5, .9)
.TRUE
use the cov.trob
function in the MASS
package
to calculate the center and covariance matrix for the data ellipse.par
).par
).TRUE
then a legend for the groups is plotted in the upper margin.TRUE
then plotting parameters are reset to their previous values
when scatterplot
exits; if FALSE
then the mar
and mfcol
parameters are
altered for the current plotting device. plot
.NULL
. This function is used for its side effect: producing
a plot.graphics
, boxplot
,
jitter
scatterplot.matrix
, data.ellipse
,
par
, cov.trob
.scatterplot(prestige ~ income|type, data=Prestige, span=1)
scatterplot(vocabulary ~ education, jitter=list(x=1, y=1), data=Vocab)
scatterplot(infant.mortality ~ gdp, labels=row.names(UN), data=UN)
scatterplot(infant.mortality ~ gdp, log="xy", labels=row.names(UN), data=UN)
Run the code above in your browser using DataLab