0
1つのデータフレームを操作する4つのアクションボタンでShiny Appを構築しようとしています。私は、例えば、最初の行を削除することをクリックして、データフレーム上で自分のアクションボタンを連続して動作させようとしました。 49回、私はcars
の最後の行を得ることができます。私はそのためui.Rを書いた:R Shinyの複数のアクションボタンを使ってデータフレームを連続して操作する方法は?
#ui.R
shinyUI(pageWithSidebar(
headerPanel("actionButton test"),
sidebarPanel(
actionButton("delete_top_1", "Delete The First Row"),
p("Click the button to delete the first row"),
#cars[-1, ]
br(),
actionButton("delete_last_1", "Delete the Last Row"),
p("Click the button to delete the last row"),
#cars[-nrow(cars), ]
br(),
actionButton("delete_top_2", "Delete the Top 2 Rows"),
p("Click the button to delete the top 2 rows"),
#cars[-1:-2, ]
br(),
actionButton("delete_last_2", "Delete the Last 2 Rows"),
p("Click the button to delete the last 2 rows")
#cars[-nrow(cars):-(nrow(cars)-1), ]
),
mainPanel(
tableOutput('view')
)
))
は、しかし、私はserver.R部分にこだわっています、私はcars
を交換するreactiveValue()
を使用して考えています。誰かが私のサーバー上のサンプルコードを与えることができます.Rの部分?
ワウ!期待どおりに機能しました!どうもありがとうございます、私は 'reactiveValues()'と 'observeEvent()'について読んで時間を割きます! – tonykuoyj