rshinyggvisrpivottable

ggvis and rpivottable conflict in Shiny


I am plotting ggvis plot in one tab and generating a rPivottable in another tab. If I add both to ui.R, I am unable to generate the Pivot table.

Below is a sample example.

app <- shinyApp(ui = fluidPage(navbarPage("v0.5",
                               tabPanel("Report",sidebarLayout(
                                 sidebarPanel(actionButton("bbutton","Generate Report")),
                                 mainPanel(rpivotTableOutput("myPivot"),verbatimTextOutput("mytext")))),
                               tabPanel("PLOT",sidebarLayout(
                                 sidebarPanel(actionButton("cButton","Plot")),#mainPanel()
                                 mainPanel(ggvisOutput("myPlot"))
                               )
                               )

)),
  server = function(input,output){
    observe({
      input$bbutton

      output$mytext <- renderText("Hello There")
      #mydata <- getPivotTableData()
      mydata <- mtcars


      output$myPivot <- renderRpivotTable({
        rpivotTable(data = mydata)
      })

    })
  }
)

runApp(app)

If I takeout the code

mainPanel(ggvisOutput("myPlot"))

and insert

mainPanel()

the pivot table is generated just fine.

I am using the following versions: ggvis_0.4.2 rpivotTable_0.1.5.20

Any help?

Thanks


Solution

  • This was a know bug due to difference in jQuery version used by ggvis and rpivottable. Download the latest version of ggvis from Github to resolve the issue. I am currently using the following version for rpivottable and ggivs and it works. ggvis: ggvis_0.4.2.9000 rpivottable: rpivotTable_0.1.5.20