0

Shiny を使用して R でツールを作成しています。これは私の最初のものであり、ユーザー定義の入力に基づいてヒストグラムを動的に変更するのに問題があります。私は非常に単純なテーブルを持っていますが、それを目的の方法で動作させることができますが、プロットでこれを行うことができないようです。これが私がテーブルでそれをやっている方法です。

output$view <- renderTable({
  head(
subset(
  offerwallData, 
            platform == formulaTextPlatform() & 
            source == formulaTextSource() &
            type == formulaTextType() &
            price == formulaTextPrice() &
            country == formulaTextCountry()), 100)
  })

私は何かをしたい

output$plot <- RenderPlot({
    hist(subset...
})

しかし、それは機能したくありません。

4

1 に答える 1

1

ユーザー入力に基づいて何かを動的に変更したい場合は、それをリアクティブ オブジェクトにする必要があります。次のようなもの:

my.graph <- reactive({
  head(
    subset(
      offerwallData, 
      platform == formulaTextPlatform() & 
      source == formulaTextSource() &
      type == formulaTextType() &
      price == formulaTextPrice() &
      country == formulaTextCountry()), 100)
})

output$plot <- renderPlot({
  hist(my.graph())
})
于 2013-06-18T14:52:16.127 に答える