Simple function to plot and name a linear model
lmplot(
x,
y,
xname = "X variable",
yname = "Y variable",
pngtype = c("cairo-png", "quartz", "Xlib"),
xlab = xname,
ylab = yname,
plotname = xname,
r2line = TRUE,
pointtext = FALSE,
pointlabs = x,
pointcol = "black",
savedir = "",
...
)
Invisibly saves png plot into savedir.
Explanatory variable data.
Response variable data.
Variable name for plot header.
Variable name for plot header.
Filetype for png files, alternatively try "quartz" on Mac.
X axis label, parsed from xname unless specified.
Y axis label, parsed from yname unless specified.
Filename for png, parsed from xname unless specified.
Plot rsquared trendline, default TRUE.
Label each point? Default FALSE.
Point labels, defaults to resvar value.
Points colour, default "black".
Save location, end with "/".
Allows controlling of text label params e.g. adj cex &.
Simon Dedman, simondedman@gmail.com
Errors and their origins: