I want to save my R pie plot to pptx so I managed to reach the last step of code.
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())
while running the last statement of ph_with() I am getting error saying:
Error in match.arg(type) :
'arg' should be one of “windows”, “cairo”, “cairo-png”
I would appreciate if someone could tell where I am messing up the things !!
