i working in shiny , making interactive plot ggplot2. using pull down menus on ui user can change variables plotted on x , y axes. axes labels on plot represent labels within pull down menu, not variable names actual dataset. labels in pull down menu easier interpret.
i can work on machine specifying 2 lists (one each axis) in global workspace prior running shiny app.
in global workspace 1 axis
predchoices <- c("cabezon standard length (mm)" = "predlength", "cabezon mass (g)" = "predmass") and in server.r when specify axis label in ggplot
scale_x_continuous(paste("\n",names(predchoices[predchoices == input$predvariable]))) where predvariable name of pull-down widget in ui.r. code labels axes nicely more descriptive labels.
the problem using workaround not requirements shiny app included within app, making hard post web or share others, because of need initial code setup naming lists within global workspace.
is there means within shiny of making axis labels reactive, allow them have custom names rather actual variable names (from datafile), without having make specification in global workspace prior running app?
thanks, nate
Comments
Post a Comment