R 使用“光泽”以反应性方式提供图像

R 使用“光泽”以反应性方式提供图像,r,shiny,shiny-reactivity,R,Shiny,Shiny Reactivity,我需要以某种方式将R图像反馈给一个只允许我使用HTML子集的系统,所以没有iFrame。基本上,它必须类似于'img src='https://shinyserver.com/app/image123.jpeg“/” 我正在考虑使用,但不确定它是否有效 有人有什么建议吗?我不确定这是否真的解决了你的问题,但既然你提到了shinny.router,我想水管工包也可能有用 这是一个小示例,它允许您使用R函数作为API创建图像标记 水管工.R library(shiny) library(plumbe

我需要以某种方式将R图像反馈给一个只允许我使用HTML子集的系统,所以没有iFrame。基本上,它必须类似于'img src='https://shinyserver.com/app/image123.jpeg“/”

我正在考虑使用,但不确定它是否有效


有人有什么建议吗?

我不确定这是否真的解决了你的问题,但既然你提到了
shinny.router
,我想
水管工包也可能有用

这是一个小示例,它允许您使用R函数作为API创建图像标记

水管工.R

library(shiny)
library(plumber)

#' Get an image tag with source from its name
#' @param imgsrc Source of the image
#' @get /
img2tag <- function(imgsrc = "") {
  url = paste0('https://shinyserver.com/app/', imgsrc)
  as.character(tags$img(src=url))
}
这将为您提供字符串的JSON单价:

0   "<img src=\"https://shinyserver.com/app/image123.jpeg\"/>"
你说的“R图像”是什么意思?这些图是由R生成的吗?HTML子集是允许整个img标记,还是只允许图像的url?
http://localhost:7818/?imgsrc=image123.jpeg
0   "<img src=\"https://shinyserver.com/app/image123.jpeg\"/>"
curl http://localhost:7818/?imgsrc=image123.jpeg