While reading http://ggvis.rstudio.com/interactivity.html, I noticed the code has := sprinkled in it. I assume that is a new way of providing arguments to a function? What is it exactly?
mtcars %>%
ggvis(~wt, ~mpg, size := input_slider(10, 1000)) %>%
layer_points(fill := "red") %>%
layer_points(stroke := "black", fill := NA)
In this case,
:=
is simply ggvis' syntax for assigning fixed values; in contrast,=
would here be used to assign a variable value. As you might have noticed in your code example, on the right hand side, there are only such values as "red" or NA, therefore:=
is the right operator to use in this context. If you would like "size" to depend on the "mpg" column, for example, you could writesize = mpg
, using the usual equals sign.I admit that I am not familiar enough with
:=
to say whether there are other packages which have adopted this operator as well.