timelyportfolio/sunburstR

No tidyselect variables were registered

andirey opened this issue ยท 6 comments

I used "sunburstR" package.
But now it starts generate error

rlang::last_error()

message: No tidyselect variables were registered
class: rlang_error
backtrace:

  1. shiny::runApp()
  2. shiny:::serviceApp()
  3. shiny:::flushReact()
  4. .getReactiveEnvironment()$flush()
  5. ctx$executeFlushCallbacks()
  6. base::lapply(...)
  7. shiny:::FUN(X[[i]], ...)
  8. shiny:::flushCallback()
  9. shiny:::run()
  10. ctx$run(.func)
  11. env$runWith(self, func)
  12. shiny:::contextFunc()
  13. shiny:::<observer:output$plot_races_sunburst>(...)
  14. shiny:::func()
  15. shiny:::orig(name = name, shinysession = self)
  16. shiny:::output$plot_races_sunburst(...)
  17. shiny:::origRenderFunc(...)
  18. func()
  19. sunburstR::sunburst(df, count = TRUE, legend = FALSE) app.R:562:4
  20. sunburstR:::csv_to_hier(data)
  21. d3r::d3_nest(df, value_cols = "size")
  22. dplyr::one_of(c(nonnest_cols[length(nonnest_cols)], value_cols))
  23. tidyselect::peek_vars()
  24. vars_env$selected %||% abort("No tidyselect variables were registered")
    Call rlang::last_trace() to see the full backtrace
    ==
    version of sunburstR is 2.1.2

How to fix it?

@andirey not sure but my first guess to fix would be to install the newest d3r with install.packages("d3r"). Please let me know if this fixes.

Yes. After "d3r" it works. Thanks
Why do we need d3r btw?

@andirey d3r does the conversion into expected d3 network format https://github.com/timelyportfolio/sunburstR/blob/master/R/converters.R. This is more reliable than the original JavaScript based converter.

OK. Thanks for the advice!
I hope it can be useful for someone else as well.

@andirey thanks for filing the issue. The newest tidyr required modifications because of api change. I modified d3r to accept both old and new api format. Also, I have found the data.frame based network format as illustrated in https://bl.ocks.org/timelyportfolio/e135afab3838dffd82226655245d3feb to be more workable than the original delimited structure.

Going to close. Feel free to reopen.