我有一个绘图,我想使用R Plumber在其他UI上显示绘图,例如angular。
发布于 2019-12-27 16:24:24
下面是你如何做到这一点:
# API for experimenting with html widgets
library(plumber)
library(ggplot2)
library(plotly)
#* @apiTitle HTML widgets API
#* Return interactive plot using plotly
#* @serializer htmlwidget
#* @get /plotly
function() {
p <- ggplot(data = diamonds,
aes(x = cut, fill = clarity)) +
geom_bar(position = "dodge")
ggplotly(p)
}希望这能有所帮助。
来源- https://github.com/blairj09/plumber-playground/blob/master/experiments/htmlwidgets-exp/plumber.R
https://stackoverflow.com/questions/56165795
复制相似问题