barline | R Documentation |
Draws a bar-line plot
barline(
data,
id,
bars,
line,
order.by = id,
decreasing = TRUE,
labels.bars = NULL,
label.line = NULL,
position.bars = "stack",
title = NULL
)
data |
a data frame. |
id |
character, name of the ID variable. |
bars |
character vector, names of the bar variables. |
line |
character, name of the line variable. |
order.by |
character, name of the variable used to order bars (on the x-axis). |
decreasing |
logical; if |
labels.bars |
character vector, labels for the bar variables. |
label.line |
character, label for the line variable on the second y-axis (on the right). |
position.bars |
character, used to adjust the positioning of the bars in the plot; there are four main options: |
title |
character, plot title. |
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.
dts <- subset(Pbox, Team=="Houston Rockets" & MIN>=500)
barline(data=dts, id="Player", bars=c("P2p","P3p","FTp"),
line="MIN", order.by="Player",
labels.bars=c("2P","3P","FT"), title="Houston Rockets")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.