ScatterPlot | R Documentation |
This function is a wrapper to the standard plott()
function in the graphics package. It is tailored to generating a scatter plot, and adds detail to the stored object so that a better text description can be formulated using the VI()
method in the BrailleR package. The function will become redundant once all other BrailleR functionality is working well with ggplot style graphics.
ScatterPlot(.data, x, y, base=FALSE, ...)
FittedLinePlot(.data, x, y, line.col=2, base=FALSE, ...)
.data |
the data.frame from which variables are drawn. Ignored if using base graphics. |
x,y |
numeric variables. N.B. you must explicitly specify them by naming the arguments. |
base |
Use base style graphics. Default is to use ggplot2 instead. |
line.col |
colour to be used for the fitted line; col is used to modify the colour of the points. |
... |
additional arguments passed on to the plotting function. |
These wrapper functions will draw the graphics plots for a set of points. The only difference is that the fitted line is added for the FittedLinePlot()
The original style used base graphics. Given the improved interaction of ggplot graphics for BrailleR users, the preferred style from v0.33.0 onwards was the ggplot style.
Either:
1. An object of class scatterplot of fittedlineplot, with the addition of any calls to the main title or axis labels being explicitly stored even if a zero length character string, or
2. a ggplot object.
A. Jonathan R. Godfrey
Godfrey, A.J.R. (2013) ‘Statistical Software from a Blind Person's Perspective: R is the Best, but we can make it better’, The R Journal 5(1), pp73-79.
attach(airquality)
op = par(mfcol=c(3,2))
plot(x=Wind, y=Ozone, pch=4)
test1 = ScatterPlot(x=Wind, y=Ozone, pch=4, base=TRUE)
test1 #does the plot method work?
plot(x=Wind,y= Ozone)
abline(coef(lm(Ozone~Wind)), col=4)
test2 = FittedLinePlot(x=Wind, y=Ozone, line.col=4, base=TRUE)
test2 #does the plot method work?
par(op)
detach(airquality)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.