plot.inequality: Plot Lorenz curve from a 'inequality' object

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

View source: R/plot.inequality.R

Description

Plot Lorenz curve from a 'inequality' object

Usage

1
2
## S3 method for class 'inequality'
plot(x, title = NULL, ...)

Arguments

x

an object of class inequality.

title

character, plot title.

...

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

inequality

Examples

1
2
3
4
Pbox.BN <- subset(Pbox, Team=="Brooklyn Nets")
out <- inequality(Pbox.BN$PTS, nplayers=8)
print(out)
plot(out)

Example output

Loading required package: ggplot2
Registered S3 method overwritten by 'GGally':
  method from   
  +.gg   ggplot2

If you want to reproduce the figures contained in the book of
Zuccolotto and Manisera (2020) and
if the version of your R machine is >= 3.6.0, you need to type
RNGkind(sample.kind = "Rounding")
at the beginning of your working session
$Gini
[1] 9.59

$Lorenz
      F          Q
1 0.000 0.00000000
2 0.125 0.08433908
3 0.250 0.19109195
4 0.375 0.31264368
5 0.500 0.43591954
6 0.625 0.57183908
7 0.750 0.71307471
8 0.875 0.85531609
9 1.000 1.00000000

attr(,"class")
[1] "inequality" "list"      

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