tladeras’s avatartladeras’s Twitter Archive—№ 5,443

    1. I've been reading more about mapping shiny inputs into ggplot2. I used to use: ggplot(data) + aes_string(x=input$x)
  1. …in reply to @tladeras
    However, aes_string() is deprecated. The new pattern is: ggplot(data) + aes(x= .data[[input$x]]) (note its ".data", not "data") More info here: mastering-shiny.org/action-tidy.html
    1. …in reply to @tladeras
      I'll have to update gradual introduction to Shiny to use this instead of aes_string(). #RStats
      1. …in reply to @tladeras
        You can also use the .data[[]] pattern with dplyr statements: dataset %>% group_by(.data[[input$var]]) %>% summarize(...)
        1. …in reply to @tladeras
          This is really useful in reactives, when you're using dplyr statements to dynamically filter.