simpleScatter: Create a Simple ggplot Scatter Plot

Description Usage Arguments Value Examples

View source: R/simpleScatter.R

Description

A minimal function to produce a ggplot object from two continuous varaibles.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
simpleScatter(
  data,
  x,
  y,
  xlab = deparse(substitute(x)),
  ylab = deparse(substitute(y)),
  title = NULL,
  subtitle = NULL,
  xlim = NULL,
  ylim = NULL,
  line = FALSE,
  interval = "none",
  ptalpha = 0.8,
  ...
)

Arguments

data

frame to be used.

x

X (independent) variable to be plotted.

y

Y (dependent) variable to be plotted.

xlab

Label (optional) to be placed on the x axis.

ylab

Label (optional) to be placed on the y axis.

title

Title (optional) of the chart.

subtitle

Subtitle (optional) of the chart.

xlim

Typical xlim option to limit the graphed regions of the chart.

ylim

Typical ylim option to limit the graphed regions of the chart.

line

Logical: add linear fit line to plot?

interval

Option denoting the type of interval to be plotted around linear prediction line. Option "none" is default. Other options include "confidence" and "prediction". Use of any option other than "none" will automatically change line=TRUE.

ptalpha

Alpha value (opacity) of the points graphed. Defaults to 0.8.

...

Further arguments passed to or from other methods.

Value

ggplot object

Examples

1
2
m <- mtcars
simpleScatter(m, disp, hp, title="Horsepower from Displacement")

MichaelJMahometa/SDSRegressionR documentation built on March 3, 2021, 10:51 p.m.