lollipops | R Documentation |
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."
)
data |
A data frame containing the probabilities to visualize. |
plotBackgroundColor |
The background color of the plot. |
plotBackgroundOpacity |
The opacity of the plot background. |
title |
The title of the plot. |
leftArea |
The label for the left area of the plot. |
rightArea |
The label for the right area of the plot. |
mediumText |
The font size for medium text elements. |
bigText |
The font size for big text elements. |
width |
The width of the widget (optional). |
height |
The height of the widget (optional). |
elementId |
The element ID of the widget (optional). |
logoPath |
Logo path. Defaults to |
logoSize |
Logo size. Defaults to |
logoLocation |
Logo location. |
rightAreaText |
The tooltip text for the right area of the plot. |
leftAreaText |
The tooltip text for the left area of the plot. |
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.
A HTML widget object representing the lollipop chart.
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.