【发布时间】:2022-01-19 10:48:00
【问题描述】:
我想将我的 R 饼图保存到 pptx,所以我设法到达了代码的最后一步。
df <- data.frame(Type = c('x','y'),Count = c(177,41))
ggplt <- ggplot(df, aes(x = "", y = Count, fill = Type)) +
geom_col(width = 1) +
scale_fill_manual(values = c("red", "yellow")) +
coord_polar("y") +
geom_text(aes(label = paste0("Count=",Count)), position = position_stack(vjust = 0.5))+
labs(title = "Employees Count")
myppt <- read_pptx()
myppt <- add_slide(myppt,layout="Two Content",master = "Office Theme")
myppt <- ph_with(myppt,type = "body",value = ggplt,location = ph_location_left())
在运行ph_with() 的最后一条语句时,我收到错误消息:
Error in match.arg(type) :
'arg' should be one of “windows”, “cairo”, “cairo-png”
如果有人能告诉我在哪里搞砸了,我将不胜感激!
【问题讨论】:
标签: r ggplot2 data-visualization powerpoint