ggplot-method: Plot functions

Description Usage Arguments Details Value Examples

Description

This functions plots model fit using ggplot.

Usage

1
2
## S3 method for class 'lmfit'
ggplot(x, y, ..., environment = parent.frame())

Arguments

x, y

Two vectors

...

Other arguments passed on to methods. Not currently used.

environment

If an variable defined in the aesthetic mapping is not found in the data, ggplot will look for it in this environment. It defaults to using the environment in which ggplot() is called.

Details

Visualization of linear fit (y = ax + b), using scatter plots and with regression line, as well as added details of regression equation and R^2.

Value

p

Returns a ggplot object.

Examples

1
2
3
4
library(visa)
x <- 1:10
y <- 2:11+0.5
ggplot.lmfit(x, y)

kang-yu/visa documentation built on April 21, 2021, 3:12 p.m.