plot.simplereg: Plot simple regression from a 'simplereg' object

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/plot.simplereg.R

Description

Plot simple regression from a 'simplereg' object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## S3 method for class 'simplereg'
plot(
  x,
  labels = NULL,
  subset = NULL,
  Lx = 0.01,
  Ux = 0.99,
  Ly = 0.01,
  Uy = 0.99,
  title = "Simple regression",
  xtitle = NULL,
  ytitle = NULL,
  repel = TRUE,
  ...
)

Arguments

x

an object of class simplereg.

labels

character, labels for subjects.

subset

an optional vector specifying a subset of observations to be highlighted in the graph or subset='quant' to highligh observations with coordinates above and below the upper and lower quantiles of the variables on the x- and y-axis (Lx, Ux, Ly, Uy).

Lx

numeric; if subset='quant', lower quantile for the variable on the x-axis (default = 0.01).

Ux

numeric; if subset='quant', upper quantile for the variable on the x-axis (default = 0.99).

Ly

numeric; if subset='quant', lower quantile for the variable on the y-axis (default = 0.01).

Uy

numeric; if subset='quant', upper quantile for the variable on the y-axis (default = 0.99).

title

character, plot title.

xtitle

character, x-axis label.

ytitle

character, y-axis label.

repel

logical, if TRUE (the default) text labels repel away from each other.

...

other graphical parameters.

Value

A ggplot2 object

Author(s)

Marco Sandri, Paola Zuccolotto, Marica Manisera (basketballanalyzer.help@unibs.it)

References

P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.

See Also

simplereg

Examples

1
2
3
4
5
6
Pbox.sel <- subset(Pbox, MIN >= 500)
X <- Pbox.sel$AST/Pbox.sel$MIN
Y <- Pbox.sel$TOV/Pbox.sel$MIN
Pl <- Pbox.sel$Player
mod <- simplereg(x=X, y=Y, type="lin")
plot(mod)

BasketballAnalyzeR documentation built on July 2, 2020, 2:14 a.m.