Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async with promises support for DT datatable #31

Open
jacob7182 opened this issue Jul 25, 2018 · 1 comment
Open

async with promises support for DT datatable #31

jacob7182 opened this issue Jul 25, 2018 · 1 comment

Comments

@jacob7182
Copy link

jacob7182 commented Jul 25, 2018

Hi, I had read in an earlier issue raised that Promises does not work with DT package, I tried the same and it gives the error " can only work with 2 dimensional data like data.frame or matrices" Is the issue still there with the latest version of shiny/promises on CRAN?

@jacob7182 jacob7182 changed the title async with promises executing sequentially and support for DT datatable async with promises support for DT datatable Jul 25, 2018
@trafficonese
Copy link

I think DT does work with promises.
Consider the following example, where the iris is packed in a future and passed to renderDataTable:

So maybe the problem is with the data that you pass to DT. Could you include a small example where that error appears?

library(shiny)
library(future)
library(promises)
library(DT)
plan(multiprocess)

ui <- fluidPage(
  DT::dataTableOutput("table")  
)

server <- function(input, output, session) {
  dat <- reactive({
    future({ 
      Sys.sleep(2);
      iris
    })
  })
  
  output$table <- DT::renderDataTable({
    dat() %...>%
      head()
  })
}

shinyApp(ui, server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants