I would like to be able
- Layout line chart in ggvis
- Add two interactive controls that let me set the min and max x values ββon the chart
That sounds pretty simple - my code is:
minx = minx = input_numeric(1, 'Min x-val') maxx = input_numeric(1, 'Max x-val') data.frame(train.dt) %>% ggvis(x = ~plot_idx, y = ~val) %>% layer_lines() %>% add_axis('x') %>% scale_numeric('x', domain = c(minx, maxx), clamp = T)
However, this does not work. I get this error message:
"Error in r [i1] - r [-length (r) :-( length (r) - lag + 1L)]: non-numeric argument to the binary operator."
If I replaced minx and maxx in the domain argument, for example. 1 and 10, my graphics are just fine (but are static). Any ideas?
Thanks!
source share