BrailleR (version 0.29.1)

ScatterPlot: Create a standard scatter plot with a few extra elements added to the output object

Description

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.

Usage

ScatterPlot(x, y, ...)

FittedLinePlot(x, y, line.col=2, ...)

Arguments

x,y

numeric variables.

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.

Value

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.

Details

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()

References

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.

Examples

Run this code
# NOT RUN {
attach(airquality)
op = par(mfcol=c(3,2))
plot(Wind, Ozone, pch=4)
test1 = ScatterPlot(Wind, Ozone, pch=4)
test1 #does the plot method work?
plot(Wind, Ozone)
abline(coef(lm(Ozone~Wind)), col=4)
test2 = FittedLinePlot(Wind, Ozone, line.col=4)
test2 #does the plot method work?
par(op)
detach(airquality)
rm(test1); rm(test2); rm(op)
# }

Run the code above in your browser using DataCamp Workspace