lmplot: Plot linear model for two variables with R2 & P printed and...

View source: R/lmplot.R

lmplotR Documentation

Plot linear model for two variables with R2 & P printed and saved

Description

Simple function to plot and name a linear model

Usage

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 = "",
  ...
)

Arguments

x

Explanatory variable data.

y

Response variable data.

xname

Variable name for plot header.

yname

Variable name for plot header.

pngtype

Filetype for png files, alternatively try "quartz" on Mac.

xlab

X axis label, parsed from xname unless specified.

ylab

Y axis label, parsed from yname unless specified.

plotname

Filename for png, parsed from xname unless specified.

r2line

Plot rsquared trendline, default TRUE.

pointtext

Label each point? Default FALSE.

pointlabs

Point labels, defaults to resvar value.

pointcol

Points colour, default "black".

savedir

Save location, end with "/".

...

Allows controlling of text label params e.g. adj cex &.

Details

Errors and their origins:

Value

Invisibly saves png plot into savedir.

Author(s)

Simon Dedman, simondedman@gmail.com


SimonDedman/gbm.auto documentation built on Feb. 9, 2024, 5:12 p.m.