【发布时间】:2022-01-21 10:30:28
【问题描述】:
我需要在 Shiny Flexdashboard 中构建合成图片,以将 Ggplot2 图表放置在背景图像上。
我使用以下代码:
```{r}
renderImage({
bkgDom <- image_read('background.png')
myChart <- ggplot(data=individualObs, aes(individualObs$SA)) + geom_histogram()
fig <- image_graph(width = 600, height = 550)
myChart
dev.off()
image_composite(bkgDom, fig, offset = "+1030+50", operator = "multiply") }, deleteFile = TRUE)
renderImage() 中的代码在 RStudio 中运行良好,但在 Shiny Flexdashboard 代码中使用时返回错误“'externalptr' 类型的对象不是子集”。
关于如何解决这个问题的任何想法?
提前感谢您的支持!
【问题讨论】:
标签: r shiny flexdashboard