ropensci / iheatmapr

Complex, interactive heatmaps in R
https://docs.ropensci.org/iheatmapr
Other
267 stars 35 forks source link

could not find function 'to_widget' #71

Closed whtns closed 3 years ago

whtns commented 4 years ago

I am using iheatmapr in a shiny app created by calling a package function. I am unable to run renderIheatmap or iheatmaprOutput without explicitly loading the package. instead I receive the title error message.

here's a reprex where the behavior can be replicating by excluding library(iheatmapr)

library(shiny)
# library(iheatmapr)

if (interactive()) {
  options(device.ask.default = FALSE)

  # The object can be passed to runApp()
  app <- shinyApp(
    ui = fluidPage(
      numericInput("n", "n", 1),
      iheatmapr::iheatmaprOutput("heatmap")
    ),
    server = function(input, output) {
      output$heatmap <- iheatmapr::renderIheatmap( iheatmapr::iheatmap(as.matrix(cars)))
    }
  )

  runApp(app)
}
olobiolo commented 3 years ago

I am having the same problem.

daattali commented 3 years ago

This is still an ongoing issue. The package must be explicitly attached in order to use it in shiny, which isn't great in large apps

olobiolo commented 3 years ago

@daattali Indeed, that is why I raised the issue and what I have been doing so far. Thanks for pointing to the workaround though.

AliciaSchep commented 3 years ago

I think #82 should fix this issue; at least it seems to resolve the problem for the example above.

daattali commented 3 years ago

Confirmed this is fixed!

olobiolo commented 3 years ago

Thank you!