Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

compPlot

Scatterplot to Compare two Variables


Description

Plot a scatterplot to compare two variables.

Usage

compPlot( x, y, lim = NULL, ... )

Arguments

x

values of the first variable (on the X axis).

y

values of the second variable (on the Y axis).

lim

optional vector of two elements specifying the limits of both axes).

...

further arguments are passed to plot.

Author(s)

Arne Henningsen

Examples

set.seed( 123 )
   x <- runif( 25 )
   y <- 2 + 3 * x + rnorm( 25 )
   ols <- lm( y ~ x )
   
   compPlot( y, fitted( ols ) )
   compPlot( y, fitted( ols ), lim = c( 0, 10 ) )
   compPlot( y, fitted( ols ), pch = 20 )
   compPlot( y, fitted( ols ), xlab = "observed", ylab = "fitted" )
   compPlot( y, fitted( ols ), log = "xy" )

miscTools

Miscellaneous Tools and Utilities

v0.6-26
GPL (>= 2)
Authors
Arne Henningsen, Ott Toomet
Initial release
2019-12-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.