Description Usage Arguments Value Author(s) References See Also Examples
View source: R/plot.inequality.R
Plot Lorenz curve from a 'inequality' object
1 2 |
x |
an object of class |
title |
character, plot title. |
... |
other graphical parameters. |
A ggplot2
object.
Marco Sandri, Paola Zuccolotto, Marica Manisera (basketballanalyzer.help@unibs.it)
P. Zuccolotto and M. Manisera (2020) Basketball Data Science: With Applications in R. CRC Press.
1 2 3 4 | Pbox.BN <- subset(Pbox, Team=="Brooklyn Nets")
out <- inequality(Pbox.BN$PTS, nplayers=8)
print(out)
plot(out)
|
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"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.