【发布时间】:2017-06-12 08:33:33
【问题描述】:
我正在使用 ggplot 绘制条形图,并使用 R 中的水管工包将此函数创建为 Web api。
library(plumber)
library(ggplot2)
#' @get /histogram_test
#' @png
histogram_test <- function(){
mtcars=mtcars
b=ggplot(mtcars,aes(mtcars$cyl))
b+geom_bar()
}
然后我运行:
r <- plumb("plum_api.R")
r$run(port=8000)
但这不会在浏览器上返回绘图。
【问题讨论】:
-
另见this answer,它试图解释类似的问题
标签: r asp.net-web-api ggplot2 plumber