Open git-er opened 9 years ago
To add to this, using this same mock data piped into ggvis() doesn't work either:
dfb %>% ggvis() %>% layer_lines(x= ~date_b , y= ~val_b, stroke := "red")
Error in UseMethod("as.lazy") : no applicable method for 'as.lazy' applied to an object of class "NULL"
+1 This is still a problem in December 2016, "The Year of ggvis".
dfb %>%
ggvis(x= ~date_b , y= ~val_b, stroke := "red" ) %>%
layer_paths()
works perfectly fine for me?
This is still not working in March 2019. In the RStudio ggvis example using data from Minard's famous graph of Napoleon's army's retreat in 1812 http://ggvis.rstudio.com/data-hierarchy.html, this works:
ggvis(data = NULL, x = ~long, y = ~lat) %>%
layer_points(size = ~survivors, stroke = ~direction, data = Minard.troops) %>%
layer_text(text := ~city, dx := 5, dy := -5, data = Minard.cities)
but this generates the error "Error in x$cur_data() : attempt to apply non-function":
ggvis(data = NULL, x = ~long, y = ~lat) %>%
layer_lines(size = ~survivors, stroke = ~direction, data = Minard.troops) %>%
layer_text(text := ~city, dx := 5, dy := -5, data = Minard.cities)
The following statement fails (using layer_lines):
ggvis() %>%
layer_lines(data = dfb, x= ~date_b , y= ~val_b, stroke := "red")
## Error in func() : attempt to apply non-function
However the same logic works in this case using layer_paths:
ggvis() %>%
layer_paths(data = dfb, x= ~date_b , y= ~val_b, stroke := "red")
Here is the mock data used to test the two cases above:
dfb <- data.frame(
date_b = seq(from= as.Date("2015-07-02"),
to= as.Date("2015-07-15"), by= 1),
val_b = c(3250.75429, 3505.43477, 3208.69141,
-2.08175, -27.30244, 3324.62348,
2820.91075, 3250.75429, 3505.43477,
3208.69141, -2.08175, -27.30244,
3324.62348, 2820.91075) )