I've been working with crosstalk to create linked, interactive graphics and I would like to move that function to plumber and expose it as an API. Things work fine in RMarkdown, but not in plumber.
The error I'm receiving on the plumber side is:
<simpleError in system.file(config, package = package): 'package' must be of length 1>
and the error I see in my browser is:
An exception occurred.
Here is a sample function I'm trying to use (thanks Joe Cheng)
#' Plot out data from the iris dataset
#' @get /crosstalk
#* @serializer htmlwidget
shared_mtcars <- SharedData$new(mtcars)
widths = c(3,NA,NA),
filter_checkbox("cyl", "Cylinders", shared_mtcars, ~cyl, inline = TRUE),
filter_slider("hp", "Horsepower", shared_mtcars, ~hp, width = "100%"),
filter_select("auto", "Automatic", shared_mtcars, ~ifelse(am == 0, "Yes", "No"))
d3scatter(shared_mtcars, ~wt, ~mpg, ~factor(cyl), width="100%", height=250),
d3scatter(shared_mtcars, ~hp, ~qsec, ~factor(cyl), width="100%", height=250)
Thanks for any advice.