一个实现界面面板调整ggplot主题的R包,它由shiny封装、Rstudioapi接口集成。通过鼠标调整ggplot参数,生成ggplot代码。
https://github.com/calligross/ggthemeassist
https://cran.r-project.org/web/packages/ggThemeAssist/ggThemeAssist.pdf
if (!requireNamespace("devtools", quietly = TRUE))
install.packages("devtools")
devtools::install_github("calligross/ggthemeassist")
gg <- ggplot(mtcars,aes(x=hp,y=mpg,colour=as.factor(cyl)))+geom_point()
ggThemeAssistGadget(gg)
# 调整参数自动生成以下代码
gg + theme(panel.grid.major = element_line(colour = "gray92"),
panel.grid.minor = element_line(colour = "gray93"),
panel.background = element_rect(fill = "aliceblue"),
plot.background = element_rect(colour = NA,
linetype = "longdash")) +labs(title = "my car", subtitle = "shangmian",
caption = "xiamian")