pyramid: Distribution Population Pyramid.

Description Usage Arguments Value Examples

View source: R/pyramid.R

Description

pyramid function will draw Population Pyramid for Distribution analysis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pyramid(
  data,
  x,
  y,
  col.var,
  title = NULL,
  subtitle = NULL,
  xtitle = NULL,
  ytitle = NULL,
  caption = NULL
)

Arguments

data

input data.frame

x

x variable

y

y variable

col.var

color variable

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
# Read data
email_campaign_funnel <- read.csv("https://raw.githubusercontent.com/selva86/datasets/master/email_campaign_funnel.csv")

#Population Pyramid
plot<- pyramid(data=email_campaign_funnel,x="Stage",y="Users",col.var="Gender",
               title = "Title")
plot

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