Learn R Programming

billboarder (version 0.2.4)

bb_piechart: Helper for creating a pie chart

Description

Helper for creating a pie chart

Usage

bb_piechart(bb, data, mapping = NULL, ...)

Arguments

bb

A billboard htmlwidget object.

data

A data.frame, first column should contain labels, second column values associated, except if mapping is provided.

mapping

Mapping of variables on the chart, see bbaes.

Value

A billboard htmlwidget object.

Examples

Run this code
# NOT RUN {
stars <- data.frame(
  package = c("billboarder", "ggiraph", "officer", "shinyWidgets", "visNetwork"),
  stars = c(9, 177, 43, 44, 169)
)

# Default
billboarder() %>% 
  bb_piechart(data = stars)

# Explicit mapping
billboarder() %>% 
  bb_piechart(data = stars, bbaes(package, stars))

# Other way to specify mapping
billboarder(data = stars) %>% 
  bb_aes(package, stars) %>% 
  bb_piechart()

# }

Run the code above in your browser using DataLab