1-dataframe 2-ggplotのリストを返す関数Identify_IP()があります。私はShinyAppでrenderTableとrenderPlotをする必要があります。このshinyAppコードは、データフレームのみをレンダリングします。しかし、私はプロットを描画することはできません。どんな助け?次server
を使用してShinyAppの複数のオブジェクトのリストからプロットをレンダリングする方法
library(shiny)
source('InflectionP2.R', local = TRUE)
runApp(
list(
ui = fluidPage(
titlePanel("Upload your file"),
sidebarLayout(
sidebarPanel(
fileInput('file1', 'Choose xls file',
accept = c(".XLS")),
actionButton("btn", "Update Table"),
actionButton("btn1", "Display Plot"),
downloadButton('downloadData', 'Download')
),
mainPanel(
tableOutput('what'),
plotOutput('pl'))
)
)
,
server = function(input, output, session){
dataOP <- reactive({
inFile <- input$file1
if (is.null(input$file1))
return(NULL)
Identify_IP(read.table(inFile$datapath))
list(tble = df1, txt = inflection_points, plt = p)
})
observeEvent(input$btn, output$what <- renderTable({dataOP()$tble}))
observeEvent(input$btn1, output$pl <- renderPlot({
plot(dataOP()$plt)
}))
}
))
'dataOP()$ p'をプロットする必要があります。 'plot()'を使用して –
詳細を教えてください。それは私がすでに行ったこととどう違うのですか? – user91
そして、btw、私はdataOP()$ df1を試して、テーブルをレンダリングしなかったので、リストが動作するとは思わない。だから私はdataOP()のために解決しました – user91