library(officer)
dat <- data.frame(
region = c("EU", "EU", "EU", "AM", "AM"),
country = c("FR", "FR", "DE", "US", "US"),
city = c("Paris", "Lyon", "Berlin", "NYC", "LA"),
value = c(10, 5, 12, 20, 8),
stringsAsFactors = FALSE
)
sb <- ms_sunburstchart(
data = dat, path = c("region", "country", "city"), value = "value"
)
doc <- read_pptx()
doc <- add_slide(doc)
doc <- ph_with(doc, sb, location = ph_location_fullsize())
print(doc, target = tempfile(fileext = ".pptx"))
Run the code above in your browser using DataLab