R 图像输出大小更改

R 图像输出大小更改,r,shiny,R,Shiny,我有大小为1770x2101像素(l.png、n.png、a.png)的图像,需要渲染100*300像素大小的图像 用户界面 服务器 output$myImage <-renderImage({ if (input$l == 'l') Leg<-"www/l.png" if (input$l == 'n') Leg<-"www/n.png" if (input$l == 'b') Leg<-"www/b.png"

我有大小为1770x2101像素(l.png、n.png、a.png)的图像,需要渲染100*300像素大小的图像

用户界面

服务器

output$myImage <-renderImage({
if (input$l == 'l') Leg<-"www/l.png"
if (input$l == 'n') Leg<-"www/n.png"
if (input$l == 'b') Leg<-"www/b.png"
if (input$l == 'a') Leg<-"www/a.png"
list(src=Leg)
},deleteFile = FALSE)

output$myImage您必须在
renderImage
中设置尺寸:

list(src = Leg, width = "100%", height = "300")
list(src = Leg, width = "100%", height = "300")