View source: R/plot_dumbbell.R
plot_dumbbell | R Documentation |
Dumbbell plot in kedata style
plot_dumbbell(
data,
cat,
x1,
x2,
size,
x_title,
y_title,
title,
subtitle,
data_source
)
data |
data frame |
cat |
character |
x1 |
colname 1 |
x2 |
colname 2 |
size |
numerik |
x_title |
character |
y_title |
character |
title |
character |
subtitle |
character |
data_source |
character |
ggplot object
## Not run:
library(dataplot)
s <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/school_earnings.csv")
s$School <- factor(s$School, levels = s$School[order(s$Men)])
plot_dumbbell(data = s,
cat = "School",
x1 = "Women",
x2 = "Men",
size = 3,
x_title = "Salary",
y_title = "School",
title = "Gender earnings disparity",
subtitle = "Gender earnings disparity from Women VS Men based on University",
data_source = "www.kedata.online")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.