plot_waffle: Waffle chart in kedata style

View source: R/plot_waffle.R

plot_waffleR Documentation

Waffle chart in kedata style

Description

Waffle chart in kedata style

Usage

plot_waffle(data, x, y, ndeep, title, subtitle, data_source)

Arguments

data

data frame

x

character of column name for x axis

y

character of column name for y axis

ndeep

number of waffle

title

character for plot title

subtitle

character for plot subtitle

data_source

character for footer text

Value

ggplot object

Examples

## Not run: 
library(ggplot2)
library(dataplot)

df <- structure(list(
  region = c(
    "Africa", "Asia", "Latin America",
    "Other", "US-born"
  ),
  ncases = c(36L, 34L, 56L, 2L, 44L)
),
.Names = c("region", "ncases"),
row.names = c(NA, -5L), class = "data.frame"
)

plot_waffle(
  data = df, x = "region", y = "ncases", ndeep = 10,
  title = "Lorem Ipsum is simply dummy text",
  subtitle = "Contrary to popular belief, Lorem Ipsum is not simply random text",
  data_source = "www.kedata.online"
)

## End(Not run)

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