This code generates the chart I want, but I would like to pass the content of input_radiobuttons
as vertical axis label in place of the random string reactive_931110099
.
library(ggvis)
mtcars %>% ggvis(x = ~wt, y= input_radiobuttons(
choices = c("mpg" = 'mpg', "disp" = 'disp'),
label = "Y-axis",
map = as.name)
)
layer_densities(
adjust = input_slider(.1, 2, value = 1, step = .1, label = "Bandwidth adjustment"),
kernel = input_select(
c("Gaussian" = "gaussian",
"Epanechnikov" = "epanechnikov",
"Rectangular" = "rectangular",
"Triangular" = "triangular",
"Biweight" = "biweight",
"Cosine" = "cosine",
"Optcosine" = "optcosine"),
label = "Kernel")
)