0
シンプルなShiny Appを構築しようとしていますが、動作させることができません。私は状態を選択したいとアプリは、オゾンレベルのsample.measurementのためのその状態の平均を計算する必要があります。ここに私のui.Rコードは次のとおりです。ShinyのSelectInput
require(shiny)
fluidPage(pageWithSidebar(
headerPanel("Ozone Pollution"),
sidebarPanel(
h3('State'),selectInput("inputstate","Select State",state.name)),
mainPanel(
h3('Results'),verbatimTextOutput("res")
)
))
そして、ここでは私のserver.Rプログラムは次のとおりです。
require(dplyr)
library(shiny)
shinyServer(
function(input, output) {
stat_state<-reactive({filter(ozone_2015,State.Name==input$inputstate)})
output$res<- renderPrint({mean(stat_state$Sample.Measurement)})
}
)
任意のヒント?ありがとう.....
この 'stat_state $ Sample.Measurement'をこの' stat_state()$ Sample.Measurement'に変更することがあります。 – zx8754