Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- years <- c(2017,2018,2019,2017,2017,2018,2018,2019)
- obs <- c("a","b","c","d","e","f","g","h")
- df <- data.frame(years,obs)
- anos <- unique(df$years)
- for (val in anos){
- assign(paste0("df_",val), filter(df, years == val))
- }
- library(shiny)
- years <- c(2017,2018,2019,2017,2017,2018,2018,2019)
- obs <- c("a","b","c","d","e","f","g","h")
- df <- data.frame(years,obs)
- ui <- fluidPage(
- sidebarPanel(
- radioButtons("year","year",choices=c(2017,2018,2019)),
- pickerInput("valor","valor",choices=obs,selected=obs,multiple=TRUE)
- ),
- mainPanel(
- htmlOutput("result")
- )
- )
- server <- function(input,output,session){
- df_val <- reactive({
- filter(df, obs %in% input$valor)
- })
- anos <- reactive(unique(df_val()$years))
- for (val in anos){
- assign(paste0("df_",val),filter(df_val(), years == val))
- }
- }
- shinyApp(ui=ui,server=server)
- Error in server(...) :
- long vectors not supported yet: ../../../../R-3.5.3/src/main/eval.c:2204
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement