This function creates a lollipop chart to visualize probabilities.
lollipops(
data,
plotBackgroundColor = "white",
plotBackgroundOpacity = 0.8,
title = "Probability of an impact",
leftArea = "Negative",
rightArea = "Positive",
mediumText = 18,
bigText = 28,
width = NULL,
height = NULL,
elementId = NULL,
logoPath = NULL,
logoSize = 100,
logoLocation = c("bottom-left", "top-left", "top-right", "bottom-right"),
rightAreaText = "A positive impact is not necesarly a large impact.",
leftAreaText = "A negative impact is not necesarly a large impact."
)
A data frame containing the probabilities to visualize.
The background color of the plot.
The opacity of the plot background.
The title of the plot.
The label for the left area of the plot.
The label for the right area of the plot.
The font size for medium text elements.
The font size for big text elements.
The width of the widget (optional).
The height of the widget (optional).
The element ID of the widget (optional).
Logo path. Defaults to NULL
.
Logo size. Defaults to FALSE
.
Logo location. c('bottom-right', 'top-left', 'top-right', 'bottom-left')
.
The tooltip text for the right area of the plot.
The tooltip text for the left area of the plot.
A HTML widget object representing the lollipop chart.
The data frame should have three columns: `name`, `value`, and `color`. The `name` column specifies the names of the data points, while the `value` column specifies the corresponding probabilities. The `color` column specifies the color of each lollipop.
data <- data.frame(
Name = c("Outcome 1", "Outcome 2", "Outcome 3"),
Prior = c(0.5, 0.5, 0.5),
Posterior = c(0.2, 0.6, 0.9)
)
lollipops(data,
logoPath = 'https://upload.wikimedia.org/wikipedia/commons/b/b8/YouTube_Logo_2017.svg',
logoLocation = 'bottom-left')