Rのshinyで、uiサイドでfileInputで読み込んだ画像を、mainPanelに表示する方法を教えてください。
以下のように書きましたが、画像が表示されずに困っています。
library(shiny)
shinyUI(fluidPage(
titlePanel("TCF"),
fluidRow(
column(2,
fileInput("file1", "Choose image File",
multiple = TRUE,
accept = c(".png","bmp","jpeg","jpg"))
),
column(10,
mainPanel( fluidRow( column(12, imageOutput("image")) ) )) )
))
library(shiny)
shinyServer(function(input, output) {
output$image <- renderPlot({ req(input$file1) bmp(input$file1$datapath,width=300,height=300)
})
})
回答1件
あなたの回答
tips
プレビュー