dumbbell: Ranking Dumbbell Plot.

Description Usage Arguments Value Examples

View source: R/dumbbell.R

Description

dumbbell function will draw Dumbbell Plot for Ranking analysis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
dumbbell(
  data,
  group,
  dif.var,
  value.var,
  start = "min",
  end = "max",
  title = NULL,
  subtitle = NULL,
  xtitle = NULL,
  ytitle = NULL,
  caption = NULL
)

Arguments

data

input data.frame

group

group variable

dif.var

difference variable

value.var

value variable

start

start value

end

end value

title

input data.frame

subtitle

date variable

xtitle

value variable

ytitle

input data.frame

caption

date variable

Value

An object of class ggplot

Examples

1
2
3
4
5
6
7
8
# prep data
gapminder <- gapminder %>% group_by(continent,year) %>%
             summarise(meangdppercap=mean(gdpPercap)) %>% as.data.frame(.)
gapminder[59,"meangdppercap"]<-20088.78

#dumbbell plot
plot<- dumbbell(data=gapminder,group="continent",dif.var="year",value.var="meangdppercap",start=1997,end=2002)
plot

HeeseokMoon/ggedachart documentation built on Dec. 31, 2020, 12:59 p.m.