2017-11-03 8 views
0

もう一度。プロジェクトに取り組んでいると私は立ち往生しています。私のクリックは機能していません。私はすべての反復を試みましたが、それを理解することはできません。基本的には、クリックでデータテーブル内の複数の線を選択する必要があります。その時点でフィルタリングをいくつか行います。クリックして問題が発生しています。ここに私のコードがあります...私は何かが見当たりませんか?ありがとう。 ライブラリ(予報) ライブラリ(光沢) ライブラリ(shinythemes) ライブラリ(ggplot2) ライブラリ(dplyr) ライブラリ(スケール) ライブラリ(光沢) ライブラリ ライブラリ(DT)Shiny Datatable Click IDが機能しない

ライブラリ(予報) (shinythemes) ライブラリ(ggplot2) ライブラリ(dplyr) ライブラリー(スケール) ライブラリ(DT)

source("NEW.R", local = TRUE) 

branch1 <- unique(distinctlineitems$BRANCH) 


ui <- navbarPage(
theme = shinytheme("cosmo"), 
title = "EXPENDITURES", 
tabPanel("TAB1", 

     sidebarLayout(
     sidebarPanel(
      checkboxGroupInput("branches",label = NULL,choices = branch1  ,selected = NULL), 
      actionButton('selectallB','Select All'), 
      textInput("words", "Search"), 
      h5("Separate keywords with commas."), 
      plotOutput("plot", width = "100%"), 
      plotOutput("season", width = "100%")), 



     # Show a plot of the generated distribution 
     mainPanel(
      fluidRow(csvDownloadUI("dwnld", "DOWNLOAD"), style =  "padding:10px"), 
      DT::dataTableOutput("table") 

server <- function(input, output, session) { 
branchfilter <- reactive({ 
filt <- distinctlineitems[distinctlineitems$BRANCH %in% input$branches,] 
return(filt) 
}) 

graphids <- reactive({ 
if(length(input$table_rows_selected) < 1) return(NULL) 
id <- input$table_rows_selected 
x <- branchfilter()$REMARKS[id] 
}) 
output$table <- renderDataTable({ 
    test <- DT::datatable(branchfilter(), 
       filter = "top", 
       rownames = FALSE, 
       selection = "multiple") 

}) 
+2

あなたの「ui」は何ですか? –

+1

もっと重要なことに、 'wordreact()'はどこに定義されていますか? –

+0

あなたは私のためにこれを閉じますか?ありがとう。 – astronomerforfun

答えて

0

は、私はできたが判明私自身の質問に答えてください。 Reactiveでテストしようとしていたので、出力を見ることができませんでした。テストするために、私は観察声明に包まなければならなかった。とても簡単。事後に。ありがとうtobiaseli_te。

observe(print(graphids())

関連する問題