plot_dumbbell: Dumbbell plot in kedata style

View source: R/plot_dumbbell.R

plot_dumbbellR Documentation

Dumbbell plot in kedata style

Description

Dumbbell plot in kedata style

Usage

plot_dumbbell(
  data,
  cat,
  x1,
  x2,
  size,
  x_title,
  y_title,
  title,
  subtitle,
  data_source
)

Arguments

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

Value

ggplot object

Examples

## 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)

eppofahmi/dataplot documentation built on Jan. 22, 2025, 1:14 a.m.