rstudio/ggvis

Error in UseMethod("as.lazy")

Opened this issue · 2 comments

This error Error in UseMethod("as.lazy") only appears in layer_lines() using the following example

ex <- data.frame("x" = c(1:10), "y" = c(1:10))
ex %>% ggvis() %>% layer_lines(~x, ~y) # ERROR

However, it works for layer_points() and layer_paths()

ex %>% ggvis() %>% layer_points(~x, ~y) # GOOD
ex %>% ggvis() %>% layer_paths(~x, ~y) #GOOD

Same error here when trying to use two input_select (one for x, one for y). Works fine points and paths, fails with layer.

*** The title of this issue could be better

I'm a little ignorant of the code base, but layer_lines() may be pulling the current value of x incorrectly:

function (vis, ...)
{
x_var <- vis$cur_props$x$value
layer_f(vis, function(x) {
x <- auto_group(x, exclude = c("x", "y"))
x <- dplyr::arrange_(x, x_var)
emit_paths(x, props(...))
})
}