let user create different button actions in shinydashboard app





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







4















I want to build a shiny app that allows the user to select some columns to filter a data.table.



My real data has ~110 columns and the columns are numeric, character, factor, integer



I want to have a pre-selected filter in the sidebar panel but also to have a + button to allow the user to create custom filters based on the columns. I don't know if this can be done in shiny or not, I have read about insertUI and removeUI but I don't know if this could be applied to this case. Also the user-created filters should be applied consecutively, i.e, if user creates three filters, then filter1 should be applied, then filter2, and then filter3.



I have this little example app where there is an initial filter based on Person using textAreaInput (my final user would like to paste some names on the box to filter out the table) but I would like to add some another filters, for example a sliderInput for votes or a dropdownMenu for letters.



library(shinydashboard)
library(dplyr)
library(shiny)
library(DT)

header <- dashboardHeader(title="Analysis and database")

sidebar <- dashboardSidebar(
sidebarMenu(
# Setting id makes input$tabs give the tabName of currently-selected tab
id = "sidebarmenu",
menuItem("Database", tabName="db"),
menuItem("Search by Name", tabName = "Filt_table"),
textAreaInput("name_", "Name")
)
)

body <- dashboardBody(

tabItems(
tabItem("db","table content",
fluidRow(DT::dataTableOutput('tabla'))),
tabItem("Filt_table","Filtered table content",
fluidRow(DT::dataTableOutput('tablafilt')))
)
)

ui <- dashboardPage(header, sidebar, body)

### SERVER SIDE

server = function(input, output, session) {

my_data <- data.frame(Person=c("Anne", "Pete", "Rose", "Julian", "Tristan", "Hugh"),
Votes=c(10,25,56,89.36,78,1500),
Stuff=c("test|3457678", "exterm|4567sdf", "1001(hom);4.3.4|3456", "xdfrtg", "1234|trsef|456(het)", "hyggas|tertasga"),
letters=replicate(6, paste(sample(LETTERS,6, replace=T), collapse="")))

output$tabla <- DT::renderDataTable({
DT::datatable(my_data)
})

filtered <- reactive({
if(is.null(input$name_))
return()
glist <- isolate(input$name_)
filter(my_data, Person %in% glist)
})

output$tablafilt <- DT::renderDataTable({
if(is.null(input$name_))
return()

DT::datatable(filtered (),
filter = 'top',
extensions = 'Buttons',
options = list(
dom = 'Blftip',
buttons =
list('colvis', list(
extend = 'collection',
buttons = list(list(extend='csv',
filename = 'results'),
list(extend='excel',
filename = 'results'),
list(extend='pdf',
filename= 'results')),
text = 'Download'
)),
scrollX = TRUE,
pageLength = 5,
lengthMenu = list(c(5, 15, -1), list('5', '15', 'All'))
), rownames = FALSE
)
})



}
shinyApp(ui, server)









share|improve this question

























  • just to be sure. I see that you are using the argument filter = "top" (although it doesnt appear in your example). How would the desired renderUI() functionality differ from the filter argument in the datatable? See 2.8 in rstudio.github.io/DT.

    – BigDataScientist
    Jan 9 at 14:34













  • @BigDataScientist, thanks for the comment, actually my desired renderUi() should imitate the functionality of top. the problem is that my actual table has 140 columns, and the users don't want to scroll horizontally to apply a filter and sometimes in DT with so many columns the scroll doesn't work very well and the data doesn't fit properly. The problem is also that some user would want to filter for several columns and other user would filter by other ones. So the idea is let the user create filters (numeric, by factor, etc) according to column names, besides the texInputArea is common

    – user2380782
    Jan 9 at 15:26













  • makes perfect sense, thx for the clarification!

    – BigDataScientist
    Jan 9 at 15:28











  • This look a lot like what I'm trying to achieve, have a look here : stackoverflow.com/questions/54114153/… and the linked SO that have a working version of it

    – Serk
    Jan 10 at 11:02




















4















I want to build a shiny app that allows the user to select some columns to filter a data.table.



My real data has ~110 columns and the columns are numeric, character, factor, integer



I want to have a pre-selected filter in the sidebar panel but also to have a + button to allow the user to create custom filters based on the columns. I don't know if this can be done in shiny or not, I have read about insertUI and removeUI but I don't know if this could be applied to this case. Also the user-created filters should be applied consecutively, i.e, if user creates three filters, then filter1 should be applied, then filter2, and then filter3.



I have this little example app where there is an initial filter based on Person using textAreaInput (my final user would like to paste some names on the box to filter out the table) but I would like to add some another filters, for example a sliderInput for votes or a dropdownMenu for letters.



library(shinydashboard)
library(dplyr)
library(shiny)
library(DT)

header <- dashboardHeader(title="Analysis and database")

sidebar <- dashboardSidebar(
sidebarMenu(
# Setting id makes input$tabs give the tabName of currently-selected tab
id = "sidebarmenu",
menuItem("Database", tabName="db"),
menuItem("Search by Name", tabName = "Filt_table"),
textAreaInput("name_", "Name")
)
)

body <- dashboardBody(

tabItems(
tabItem("db","table content",
fluidRow(DT::dataTableOutput('tabla'))),
tabItem("Filt_table","Filtered table content",
fluidRow(DT::dataTableOutput('tablafilt')))
)
)

ui <- dashboardPage(header, sidebar, body)

### SERVER SIDE

server = function(input, output, session) {

my_data <- data.frame(Person=c("Anne", "Pete", "Rose", "Julian", "Tristan", "Hugh"),
Votes=c(10,25,56,89.36,78,1500),
Stuff=c("test|3457678", "exterm|4567sdf", "1001(hom);4.3.4|3456", "xdfrtg", "1234|trsef|456(het)", "hyggas|tertasga"),
letters=replicate(6, paste(sample(LETTERS,6, replace=T), collapse="")))

output$tabla <- DT::renderDataTable({
DT::datatable(my_data)
})

filtered <- reactive({
if(is.null(input$name_))
return()
glist <- isolate(input$name_)
filter(my_data, Person %in% glist)
})

output$tablafilt <- DT::renderDataTable({
if(is.null(input$name_))
return()

DT::datatable(filtered (),
filter = 'top',
extensions = 'Buttons',
options = list(
dom = 'Blftip',
buttons =
list('colvis', list(
extend = 'collection',
buttons = list(list(extend='csv',
filename = 'results'),
list(extend='excel',
filename = 'results'),
list(extend='pdf',
filename= 'results')),
text = 'Download'
)),
scrollX = TRUE,
pageLength = 5,
lengthMenu = list(c(5, 15, -1), list('5', '15', 'All'))
), rownames = FALSE
)
})



}
shinyApp(ui, server)









share|improve this question

























  • just to be sure. I see that you are using the argument filter = "top" (although it doesnt appear in your example). How would the desired renderUI() functionality differ from the filter argument in the datatable? See 2.8 in rstudio.github.io/DT.

    – BigDataScientist
    Jan 9 at 14:34













  • @BigDataScientist, thanks for the comment, actually my desired renderUi() should imitate the functionality of top. the problem is that my actual table has 140 columns, and the users don't want to scroll horizontally to apply a filter and sometimes in DT with so many columns the scroll doesn't work very well and the data doesn't fit properly. The problem is also that some user would want to filter for several columns and other user would filter by other ones. So the idea is let the user create filters (numeric, by factor, etc) according to column names, besides the texInputArea is common

    – user2380782
    Jan 9 at 15:26













  • makes perfect sense, thx for the clarification!

    – BigDataScientist
    Jan 9 at 15:28











  • This look a lot like what I'm trying to achieve, have a look here : stackoverflow.com/questions/54114153/… and the linked SO that have a working version of it

    – Serk
    Jan 10 at 11:02
















4












4








4








I want to build a shiny app that allows the user to select some columns to filter a data.table.



My real data has ~110 columns and the columns are numeric, character, factor, integer



I want to have a pre-selected filter in the sidebar panel but also to have a + button to allow the user to create custom filters based on the columns. I don't know if this can be done in shiny or not, I have read about insertUI and removeUI but I don't know if this could be applied to this case. Also the user-created filters should be applied consecutively, i.e, if user creates three filters, then filter1 should be applied, then filter2, and then filter3.



I have this little example app where there is an initial filter based on Person using textAreaInput (my final user would like to paste some names on the box to filter out the table) but I would like to add some another filters, for example a sliderInput for votes or a dropdownMenu for letters.



library(shinydashboard)
library(dplyr)
library(shiny)
library(DT)

header <- dashboardHeader(title="Analysis and database")

sidebar <- dashboardSidebar(
sidebarMenu(
# Setting id makes input$tabs give the tabName of currently-selected tab
id = "sidebarmenu",
menuItem("Database", tabName="db"),
menuItem("Search by Name", tabName = "Filt_table"),
textAreaInput("name_", "Name")
)
)

body <- dashboardBody(

tabItems(
tabItem("db","table content",
fluidRow(DT::dataTableOutput('tabla'))),
tabItem("Filt_table","Filtered table content",
fluidRow(DT::dataTableOutput('tablafilt')))
)
)

ui <- dashboardPage(header, sidebar, body)

### SERVER SIDE

server = function(input, output, session) {

my_data <- data.frame(Person=c("Anne", "Pete", "Rose", "Julian", "Tristan", "Hugh"),
Votes=c(10,25,56,89.36,78,1500),
Stuff=c("test|3457678", "exterm|4567sdf", "1001(hom);4.3.4|3456", "xdfrtg", "1234|trsef|456(het)", "hyggas|tertasga"),
letters=replicate(6, paste(sample(LETTERS,6, replace=T), collapse="")))

output$tabla <- DT::renderDataTable({
DT::datatable(my_data)
})

filtered <- reactive({
if(is.null(input$name_))
return()
glist <- isolate(input$name_)
filter(my_data, Person %in% glist)
})

output$tablafilt <- DT::renderDataTable({
if(is.null(input$name_))
return()

DT::datatable(filtered (),
filter = 'top',
extensions = 'Buttons',
options = list(
dom = 'Blftip',
buttons =
list('colvis', list(
extend = 'collection',
buttons = list(list(extend='csv',
filename = 'results'),
list(extend='excel',
filename = 'results'),
list(extend='pdf',
filename= 'results')),
text = 'Download'
)),
scrollX = TRUE,
pageLength = 5,
lengthMenu = list(c(5, 15, -1), list('5', '15', 'All'))
), rownames = FALSE
)
})



}
shinyApp(ui, server)









share|improve this question
















I want to build a shiny app that allows the user to select some columns to filter a data.table.



My real data has ~110 columns and the columns are numeric, character, factor, integer



I want to have a pre-selected filter in the sidebar panel but also to have a + button to allow the user to create custom filters based on the columns. I don't know if this can be done in shiny or not, I have read about insertUI and removeUI but I don't know if this could be applied to this case. Also the user-created filters should be applied consecutively, i.e, if user creates three filters, then filter1 should be applied, then filter2, and then filter3.



I have this little example app where there is an initial filter based on Person using textAreaInput (my final user would like to paste some names on the box to filter out the table) but I would like to add some another filters, for example a sliderInput for votes or a dropdownMenu for letters.



library(shinydashboard)
library(dplyr)
library(shiny)
library(DT)

header <- dashboardHeader(title="Analysis and database")

sidebar <- dashboardSidebar(
sidebarMenu(
# Setting id makes input$tabs give the tabName of currently-selected tab
id = "sidebarmenu",
menuItem("Database", tabName="db"),
menuItem("Search by Name", tabName = "Filt_table"),
textAreaInput("name_", "Name")
)
)

body <- dashboardBody(

tabItems(
tabItem("db","table content",
fluidRow(DT::dataTableOutput('tabla'))),
tabItem("Filt_table","Filtered table content",
fluidRow(DT::dataTableOutput('tablafilt')))
)
)

ui <- dashboardPage(header, sidebar, body)

### SERVER SIDE

server = function(input, output, session) {

my_data <- data.frame(Person=c("Anne", "Pete", "Rose", "Julian", "Tristan", "Hugh"),
Votes=c(10,25,56,89.36,78,1500),
Stuff=c("test|3457678", "exterm|4567sdf", "1001(hom);4.3.4|3456", "xdfrtg", "1234|trsef|456(het)", "hyggas|tertasga"),
letters=replicate(6, paste(sample(LETTERS,6, replace=T), collapse="")))

output$tabla <- DT::renderDataTable({
DT::datatable(my_data)
})

filtered <- reactive({
if(is.null(input$name_))
return()
glist <- isolate(input$name_)
filter(my_data, Person %in% glist)
})

output$tablafilt <- DT::renderDataTable({
if(is.null(input$name_))
return()

DT::datatable(filtered (),
filter = 'top',
extensions = 'Buttons',
options = list(
dom = 'Blftip',
buttons =
list('colvis', list(
extend = 'collection',
buttons = list(list(extend='csv',
filename = 'results'),
list(extend='excel',
filename = 'results'),
list(extend='pdf',
filename= 'results')),
text = 'Download'
)),
scrollX = TRUE,
pageLength = 5,
lengthMenu = list(c(5, 15, -1), list('5', '15', 'All'))
), rownames = FALSE
)
})



}
shinyApp(ui, server)






r shiny shinydashboard






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 9 at 16:32









BigDataScientist

7,59231838




7,59231838










asked Jan 3 at 15:12









user2380782user2380782

23331236




23331236













  • just to be sure. I see that you are using the argument filter = "top" (although it doesnt appear in your example). How would the desired renderUI() functionality differ from the filter argument in the datatable? See 2.8 in rstudio.github.io/DT.

    – BigDataScientist
    Jan 9 at 14:34













  • @BigDataScientist, thanks for the comment, actually my desired renderUi() should imitate the functionality of top. the problem is that my actual table has 140 columns, and the users don't want to scroll horizontally to apply a filter and sometimes in DT with so many columns the scroll doesn't work very well and the data doesn't fit properly. The problem is also that some user would want to filter for several columns and other user would filter by other ones. So the idea is let the user create filters (numeric, by factor, etc) according to column names, besides the texInputArea is common

    – user2380782
    Jan 9 at 15:26













  • makes perfect sense, thx for the clarification!

    – BigDataScientist
    Jan 9 at 15:28











  • This look a lot like what I'm trying to achieve, have a look here : stackoverflow.com/questions/54114153/… and the linked SO that have a working version of it

    – Serk
    Jan 10 at 11:02





















  • just to be sure. I see that you are using the argument filter = "top" (although it doesnt appear in your example). How would the desired renderUI() functionality differ from the filter argument in the datatable? See 2.8 in rstudio.github.io/DT.

    – BigDataScientist
    Jan 9 at 14:34













  • @BigDataScientist, thanks for the comment, actually my desired renderUi() should imitate the functionality of top. the problem is that my actual table has 140 columns, and the users don't want to scroll horizontally to apply a filter and sometimes in DT with so many columns the scroll doesn't work very well and the data doesn't fit properly. The problem is also that some user would want to filter for several columns and other user would filter by other ones. So the idea is let the user create filters (numeric, by factor, etc) according to column names, besides the texInputArea is common

    – user2380782
    Jan 9 at 15:26













  • makes perfect sense, thx for the clarification!

    – BigDataScientist
    Jan 9 at 15:28











  • This look a lot like what I'm trying to achieve, have a look here : stackoverflow.com/questions/54114153/… and the linked SO that have a working version of it

    – Serk
    Jan 10 at 11:02



















just to be sure. I see that you are using the argument filter = "top" (although it doesnt appear in your example). How would the desired renderUI() functionality differ from the filter argument in the datatable? See 2.8 in rstudio.github.io/DT.

– BigDataScientist
Jan 9 at 14:34







just to be sure. I see that you are using the argument filter = "top" (although it doesnt appear in your example). How would the desired renderUI() functionality differ from the filter argument in the datatable? See 2.8 in rstudio.github.io/DT.

– BigDataScientist
Jan 9 at 14:34















@BigDataScientist, thanks for the comment, actually my desired renderUi() should imitate the functionality of top. the problem is that my actual table has 140 columns, and the users don't want to scroll horizontally to apply a filter and sometimes in DT with so many columns the scroll doesn't work very well and the data doesn't fit properly. The problem is also that some user would want to filter for several columns and other user would filter by other ones. So the idea is let the user create filters (numeric, by factor, etc) according to column names, besides the texInputArea is common

– user2380782
Jan 9 at 15:26







@BigDataScientist, thanks for the comment, actually my desired renderUi() should imitate the functionality of top. the problem is that my actual table has 140 columns, and the users don't want to scroll horizontally to apply a filter and sometimes in DT with so many columns the scroll doesn't work very well and the data doesn't fit properly. The problem is also that some user would want to filter for several columns and other user would filter by other ones. So the idea is let the user create filters (numeric, by factor, etc) according to column names, besides the texInputArea is common

– user2380782
Jan 9 at 15:26















makes perfect sense, thx for the clarification!

– BigDataScientist
Jan 9 at 15:28





makes perfect sense, thx for the clarification!

– BigDataScientist
Jan 9 at 15:28













This look a lot like what I'm trying to achieve, have a look here : stackoverflow.com/questions/54114153/… and the linked SO that have a working version of it

– Serk
Jan 10 at 11:02







This look a lot like what I'm trying to achieve, have a look here : stackoverflow.com/questions/54114153/… and the linked SO that have a working version of it

– Serk
Jan 10 at 11:02














2 Answers
2






active

oldest

votes


















1





+200









You can start by creating a selectInput() for all variables as well as add and remove buttons:



  output$potentialFilter <- renderUI({
tagList(
selectInput("createFilter", "Create Filter", names(my_data)),
actionButton("remove", "remove"),
actionButton("add", "add")
)
})


And then you can create inputs for the selected variables.
Note: As you dont want to reset the inserted UIs when you add new ones you should use insertUI() instead of renderUI().



  insertUI(selector = "#add", where = "afterEnd", 
ui = selectizeInput(toBeIncluded, toBeIncluded, my_data[[toBeIncluded]],
selected = my_data[[toBeIncluded]], multiple = TRUE)
)


Full example would read:



  library(shinydashboard)
library(dplyr)
library(shiny)
library(DT)

header <- dashboardHeader(title="Analysis and database")

sidebar <- dashboardSidebar(
sidebarMenu(
# Setting id makes input$tabs give the tabName of currently-selected tab
id = "sidebarmenu",
menuItem("Database", tabName="db"),
menuItem("Search by Name", tabName = "Filt_table"),
uiOutput("potentialFilter"),
uiOutput("rendFilter")
)
)

body <- dashboardBody(

tabItems(
tabItem("db","table content",
fluidRow(DT::dataTableOutput('tabla'))),
tabItem("Filt_table","Filtered table content",
fluidRow(DT::dataTableOutput('tablafilt')))
)
)

ui <- dashboardPage(header, sidebar, body)

### SERVER SIDE

server = function(input, output, session) {

my_data <- data.frame(Person=c("Anne", "Pete", "Rose", "Julian", "Tristan", "Hugh"),
Votes=c(10,25,56,89.36,78,1500),
Stuff=c("test|3457678", "exterm|4567sdf", "1001(hom);4.3.4|3456", "xdfrtg", "1234|trsef|456(het)", "hyggas|tertasga"),
letters=replicate(6, paste(sample(LETTERS,6, replace=T), collapse="")),
stringsAsFactors = FALSE)

global <- reactiveValues(filter = c(), filteredData = my_data, tagList = tagList())

output$potentialFilter <- renderUI({
tagList(
selectInput("createFilter", "Create Filter", names(my_data)),
actionButton("remove", "remove"),
actionButton("add", "add")
)
})


observeEvent(input$add, {
global$filter <- c(global$filter, input$createFilter)
toBeIncluded <- input$createFilter
data <- my_data[[toBeIncluded]]
if(typeof(data) == "double"){
ui <- numericInput(toBeIncluded, toBeIncluded, ceiling(min(data)), min = min(data), max = max(data))
}else if(typeof(data) == "character"){
ui <- textAreaInput(toBeIncluded, toBeIncluded, data[1], width = "200px")
}
insertUI(selector = "#add", where = "afterEnd", ui = ui)
})

observeEvent(input$remove, {
global$filter <- setdiff(global$filter, input$createFilter)
removeUI(selector = paste0("div:has(> #", input$createFilter, ")"))
})

output$tabla <- DT::renderDataTable({
DT::datatable(filtered())
})

filtered <- reactive({
if(length(global$filter)){
for(filterName in global$filter){
if(is.character(input[[filterName]])){
names <- unlist(strsplit(input[[filterName]], ";"))
my_data <- my_data[my_data[[filterName]] %in% names, ]
}else if(is.numeric(input[[filterName]])){
my_data <- my_data[my_data[[filterName]] >= input[[filterName]], ]
}
}
}
return(my_data)
})

output$tablafilt <- DT::renderDataTable({
DT::datatable(filtered(),
filter = 'top',
extensions = 'Buttons',
options = list(
dom = 'Blftip',
buttons =
list('colvis', list(
extend = 'collection',
buttons = list(list(extend='csv',
filename = 'results'),
list(extend='excel',
filename = 'results'),
list(extend='pdf',
filename= 'results')),
text = 'Download'
)),
scrollX = TRUE,
pageLength = 5,
lengthMenu = list(c(5, 15, -1), list('5', '15', 'All'))
), rownames = FALSE
)
})



}
shinyApp(ui, server)


(I am not sure it makes a difference in which order you apply the filter, maybe you can ellaborate on this if I am mistaken).






share|improve this answer


























  • thanks a lot for the answer, but the "desired" behaviour would be that filters are applied consecutively, i.e, if I apply a filter by "Person", and then a filter by "Votes", only the persons selected using Person filter would be filtered by vote. Now, if I click two "newly created" filters, the first is reset and the full table is displayed. Also, is there a way to use another option for selectizeInput, my real data has 20,000 rows and selectizeInput display all the options. If is too much question, the consecutive filter would be enough. Thanks

    – user2380782
    Jan 10 at 10:17











  • sry, i got sick. I might be able to take a look, later this week.

    – BigDataScientist
    Jan 14 at 20:09











  • Hope you feel better, no worries and thank you!!!

    – user2380782
    Jan 14 at 22:22











  • @BigSataScientist did you have a change to look to this question again?

    – user2380782
    Jan 18 at 8:54













  • left the bed again today ;) I made an update. I am not sure about your selectizeInput specification. Would you replace the selectInput("createFilter", "Create Filter", names(my_data)) (top of my post) with a text input or how would you approach the 20k row challenge?

    – BigDataScientist
    Jan 18 at 19:00



















0














You can always update your filters on the spot by using



updateSelectInput and others



https://shiny.rstudio.com/reference/shiny/0.13.2/updateSelectInput.html



Best!






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54025007%2flet-user-create-different-button-actions-in-shinydashboard-app%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1





    +200









    You can start by creating a selectInput() for all variables as well as add and remove buttons:



      output$potentialFilter <- renderUI({
    tagList(
    selectInput("createFilter", "Create Filter", names(my_data)),
    actionButton("remove", "remove"),
    actionButton("add", "add")
    )
    })


    And then you can create inputs for the selected variables.
    Note: As you dont want to reset the inserted UIs when you add new ones you should use insertUI() instead of renderUI().



      insertUI(selector = "#add", where = "afterEnd", 
    ui = selectizeInput(toBeIncluded, toBeIncluded, my_data[[toBeIncluded]],
    selected = my_data[[toBeIncluded]], multiple = TRUE)
    )


    Full example would read:



      library(shinydashboard)
    library(dplyr)
    library(shiny)
    library(DT)

    header <- dashboardHeader(title="Analysis and database")

    sidebar <- dashboardSidebar(
    sidebarMenu(
    # Setting id makes input$tabs give the tabName of currently-selected tab
    id = "sidebarmenu",
    menuItem("Database", tabName="db"),
    menuItem("Search by Name", tabName = "Filt_table"),
    uiOutput("potentialFilter"),
    uiOutput("rendFilter")
    )
    )

    body <- dashboardBody(

    tabItems(
    tabItem("db","table content",
    fluidRow(DT::dataTableOutput('tabla'))),
    tabItem("Filt_table","Filtered table content",
    fluidRow(DT::dataTableOutput('tablafilt')))
    )
    )

    ui <- dashboardPage(header, sidebar, body)

    ### SERVER SIDE

    server = function(input, output, session) {

    my_data <- data.frame(Person=c("Anne", "Pete", "Rose", "Julian", "Tristan", "Hugh"),
    Votes=c(10,25,56,89.36,78,1500),
    Stuff=c("test|3457678", "exterm|4567sdf", "1001(hom);4.3.4|3456", "xdfrtg", "1234|trsef|456(het)", "hyggas|tertasga"),
    letters=replicate(6, paste(sample(LETTERS,6, replace=T), collapse="")),
    stringsAsFactors = FALSE)

    global <- reactiveValues(filter = c(), filteredData = my_data, tagList = tagList())

    output$potentialFilter <- renderUI({
    tagList(
    selectInput("createFilter", "Create Filter", names(my_data)),
    actionButton("remove", "remove"),
    actionButton("add", "add")
    )
    })


    observeEvent(input$add, {
    global$filter <- c(global$filter, input$createFilter)
    toBeIncluded <- input$createFilter
    data <- my_data[[toBeIncluded]]
    if(typeof(data) == "double"){
    ui <- numericInput(toBeIncluded, toBeIncluded, ceiling(min(data)), min = min(data), max = max(data))
    }else if(typeof(data) == "character"){
    ui <- textAreaInput(toBeIncluded, toBeIncluded, data[1], width = "200px")
    }
    insertUI(selector = "#add", where = "afterEnd", ui = ui)
    })

    observeEvent(input$remove, {
    global$filter <- setdiff(global$filter, input$createFilter)
    removeUI(selector = paste0("div:has(> #", input$createFilter, ")"))
    })

    output$tabla <- DT::renderDataTable({
    DT::datatable(filtered())
    })

    filtered <- reactive({
    if(length(global$filter)){
    for(filterName in global$filter){
    if(is.character(input[[filterName]])){
    names <- unlist(strsplit(input[[filterName]], ";"))
    my_data <- my_data[my_data[[filterName]] %in% names, ]
    }else if(is.numeric(input[[filterName]])){
    my_data <- my_data[my_data[[filterName]] >= input[[filterName]], ]
    }
    }
    }
    return(my_data)
    })

    output$tablafilt <- DT::renderDataTable({
    DT::datatable(filtered(),
    filter = 'top',
    extensions = 'Buttons',
    options = list(
    dom = 'Blftip',
    buttons =
    list('colvis', list(
    extend = 'collection',
    buttons = list(list(extend='csv',
    filename = 'results'),
    list(extend='excel',
    filename = 'results'),
    list(extend='pdf',
    filename= 'results')),
    text = 'Download'
    )),
    scrollX = TRUE,
    pageLength = 5,
    lengthMenu = list(c(5, 15, -1), list('5', '15', 'All'))
    ), rownames = FALSE
    )
    })



    }
    shinyApp(ui, server)


    (I am not sure it makes a difference in which order you apply the filter, maybe you can ellaborate on this if I am mistaken).






    share|improve this answer


























    • thanks a lot for the answer, but the "desired" behaviour would be that filters are applied consecutively, i.e, if I apply a filter by "Person", and then a filter by "Votes", only the persons selected using Person filter would be filtered by vote. Now, if I click two "newly created" filters, the first is reset and the full table is displayed. Also, is there a way to use another option for selectizeInput, my real data has 20,000 rows and selectizeInput display all the options. If is too much question, the consecutive filter would be enough. Thanks

      – user2380782
      Jan 10 at 10:17











    • sry, i got sick. I might be able to take a look, later this week.

      – BigDataScientist
      Jan 14 at 20:09











    • Hope you feel better, no worries and thank you!!!

      – user2380782
      Jan 14 at 22:22











    • @BigSataScientist did you have a change to look to this question again?

      – user2380782
      Jan 18 at 8:54













    • left the bed again today ;) I made an update. I am not sure about your selectizeInput specification. Would you replace the selectInput("createFilter", "Create Filter", names(my_data)) (top of my post) with a text input or how would you approach the 20k row challenge?

      – BigDataScientist
      Jan 18 at 19:00
















    1





    +200









    You can start by creating a selectInput() for all variables as well as add and remove buttons:



      output$potentialFilter <- renderUI({
    tagList(
    selectInput("createFilter", "Create Filter", names(my_data)),
    actionButton("remove", "remove"),
    actionButton("add", "add")
    )
    })


    And then you can create inputs for the selected variables.
    Note: As you dont want to reset the inserted UIs when you add new ones you should use insertUI() instead of renderUI().



      insertUI(selector = "#add", where = "afterEnd", 
    ui = selectizeInput(toBeIncluded, toBeIncluded, my_data[[toBeIncluded]],
    selected = my_data[[toBeIncluded]], multiple = TRUE)
    )


    Full example would read:



      library(shinydashboard)
    library(dplyr)
    library(shiny)
    library(DT)

    header <- dashboardHeader(title="Analysis and database")

    sidebar <- dashboardSidebar(
    sidebarMenu(
    # Setting id makes input$tabs give the tabName of currently-selected tab
    id = "sidebarmenu",
    menuItem("Database", tabName="db"),
    menuItem("Search by Name", tabName = "Filt_table"),
    uiOutput("potentialFilter"),
    uiOutput("rendFilter")
    )
    )

    body <- dashboardBody(

    tabItems(
    tabItem("db","table content",
    fluidRow(DT::dataTableOutput('tabla'))),
    tabItem("Filt_table","Filtered table content",
    fluidRow(DT::dataTableOutput('tablafilt')))
    )
    )

    ui <- dashboardPage(header, sidebar, body)

    ### SERVER SIDE

    server = function(input, output, session) {

    my_data <- data.frame(Person=c("Anne", "Pete", "Rose", "Julian", "Tristan", "Hugh"),
    Votes=c(10,25,56,89.36,78,1500),
    Stuff=c("test|3457678", "exterm|4567sdf", "1001(hom);4.3.4|3456", "xdfrtg", "1234|trsef|456(het)", "hyggas|tertasga"),
    letters=replicate(6, paste(sample(LETTERS,6, replace=T), collapse="")),
    stringsAsFactors = FALSE)

    global <- reactiveValues(filter = c(), filteredData = my_data, tagList = tagList())

    output$potentialFilter <- renderUI({
    tagList(
    selectInput("createFilter", "Create Filter", names(my_data)),
    actionButton("remove", "remove"),
    actionButton("add", "add")
    )
    })


    observeEvent(input$add, {
    global$filter <- c(global$filter, input$createFilter)
    toBeIncluded <- input$createFilter
    data <- my_data[[toBeIncluded]]
    if(typeof(data) == "double"){
    ui <- numericInput(toBeIncluded, toBeIncluded, ceiling(min(data)), min = min(data), max = max(data))
    }else if(typeof(data) == "character"){
    ui <- textAreaInput(toBeIncluded, toBeIncluded, data[1], width = "200px")
    }
    insertUI(selector = "#add", where = "afterEnd", ui = ui)
    })

    observeEvent(input$remove, {
    global$filter <- setdiff(global$filter, input$createFilter)
    removeUI(selector = paste0("div:has(> #", input$createFilter, ")"))
    })

    output$tabla <- DT::renderDataTable({
    DT::datatable(filtered())
    })

    filtered <- reactive({
    if(length(global$filter)){
    for(filterName in global$filter){
    if(is.character(input[[filterName]])){
    names <- unlist(strsplit(input[[filterName]], ";"))
    my_data <- my_data[my_data[[filterName]] %in% names, ]
    }else if(is.numeric(input[[filterName]])){
    my_data <- my_data[my_data[[filterName]] >= input[[filterName]], ]
    }
    }
    }
    return(my_data)
    })

    output$tablafilt <- DT::renderDataTable({
    DT::datatable(filtered(),
    filter = 'top',
    extensions = 'Buttons',
    options = list(
    dom = 'Blftip',
    buttons =
    list('colvis', list(
    extend = 'collection',
    buttons = list(list(extend='csv',
    filename = 'results'),
    list(extend='excel',
    filename = 'results'),
    list(extend='pdf',
    filename= 'results')),
    text = 'Download'
    )),
    scrollX = TRUE,
    pageLength = 5,
    lengthMenu = list(c(5, 15, -1), list('5', '15', 'All'))
    ), rownames = FALSE
    )
    })



    }
    shinyApp(ui, server)


    (I am not sure it makes a difference in which order you apply the filter, maybe you can ellaborate on this if I am mistaken).






    share|improve this answer


























    • thanks a lot for the answer, but the "desired" behaviour would be that filters are applied consecutively, i.e, if I apply a filter by "Person", and then a filter by "Votes", only the persons selected using Person filter would be filtered by vote. Now, if I click two "newly created" filters, the first is reset and the full table is displayed. Also, is there a way to use another option for selectizeInput, my real data has 20,000 rows and selectizeInput display all the options. If is too much question, the consecutive filter would be enough. Thanks

      – user2380782
      Jan 10 at 10:17











    • sry, i got sick. I might be able to take a look, later this week.

      – BigDataScientist
      Jan 14 at 20:09











    • Hope you feel better, no worries and thank you!!!

      – user2380782
      Jan 14 at 22:22











    • @BigSataScientist did you have a change to look to this question again?

      – user2380782
      Jan 18 at 8:54













    • left the bed again today ;) I made an update. I am not sure about your selectizeInput specification. Would you replace the selectInput("createFilter", "Create Filter", names(my_data)) (top of my post) with a text input or how would you approach the 20k row challenge?

      – BigDataScientist
      Jan 18 at 19:00














    1





    +200







    1





    +200



    1




    +200





    You can start by creating a selectInput() for all variables as well as add and remove buttons:



      output$potentialFilter <- renderUI({
    tagList(
    selectInput("createFilter", "Create Filter", names(my_data)),
    actionButton("remove", "remove"),
    actionButton("add", "add")
    )
    })


    And then you can create inputs for the selected variables.
    Note: As you dont want to reset the inserted UIs when you add new ones you should use insertUI() instead of renderUI().



      insertUI(selector = "#add", where = "afterEnd", 
    ui = selectizeInput(toBeIncluded, toBeIncluded, my_data[[toBeIncluded]],
    selected = my_data[[toBeIncluded]], multiple = TRUE)
    )


    Full example would read:



      library(shinydashboard)
    library(dplyr)
    library(shiny)
    library(DT)

    header <- dashboardHeader(title="Analysis and database")

    sidebar <- dashboardSidebar(
    sidebarMenu(
    # Setting id makes input$tabs give the tabName of currently-selected tab
    id = "sidebarmenu",
    menuItem("Database", tabName="db"),
    menuItem("Search by Name", tabName = "Filt_table"),
    uiOutput("potentialFilter"),
    uiOutput("rendFilter")
    )
    )

    body <- dashboardBody(

    tabItems(
    tabItem("db","table content",
    fluidRow(DT::dataTableOutput('tabla'))),
    tabItem("Filt_table","Filtered table content",
    fluidRow(DT::dataTableOutput('tablafilt')))
    )
    )

    ui <- dashboardPage(header, sidebar, body)

    ### SERVER SIDE

    server = function(input, output, session) {

    my_data <- data.frame(Person=c("Anne", "Pete", "Rose", "Julian", "Tristan", "Hugh"),
    Votes=c(10,25,56,89.36,78,1500),
    Stuff=c("test|3457678", "exterm|4567sdf", "1001(hom);4.3.4|3456", "xdfrtg", "1234|trsef|456(het)", "hyggas|tertasga"),
    letters=replicate(6, paste(sample(LETTERS,6, replace=T), collapse="")),
    stringsAsFactors = FALSE)

    global <- reactiveValues(filter = c(), filteredData = my_data, tagList = tagList())

    output$potentialFilter <- renderUI({
    tagList(
    selectInput("createFilter", "Create Filter", names(my_data)),
    actionButton("remove", "remove"),
    actionButton("add", "add")
    )
    })


    observeEvent(input$add, {
    global$filter <- c(global$filter, input$createFilter)
    toBeIncluded <- input$createFilter
    data <- my_data[[toBeIncluded]]
    if(typeof(data) == "double"){
    ui <- numericInput(toBeIncluded, toBeIncluded, ceiling(min(data)), min = min(data), max = max(data))
    }else if(typeof(data) == "character"){
    ui <- textAreaInput(toBeIncluded, toBeIncluded, data[1], width = "200px")
    }
    insertUI(selector = "#add", where = "afterEnd", ui = ui)
    })

    observeEvent(input$remove, {
    global$filter <- setdiff(global$filter, input$createFilter)
    removeUI(selector = paste0("div:has(> #", input$createFilter, ")"))
    })

    output$tabla <- DT::renderDataTable({
    DT::datatable(filtered())
    })

    filtered <- reactive({
    if(length(global$filter)){
    for(filterName in global$filter){
    if(is.character(input[[filterName]])){
    names <- unlist(strsplit(input[[filterName]], ";"))
    my_data <- my_data[my_data[[filterName]] %in% names, ]
    }else if(is.numeric(input[[filterName]])){
    my_data <- my_data[my_data[[filterName]] >= input[[filterName]], ]
    }
    }
    }
    return(my_data)
    })

    output$tablafilt <- DT::renderDataTable({
    DT::datatable(filtered(),
    filter = 'top',
    extensions = 'Buttons',
    options = list(
    dom = 'Blftip',
    buttons =
    list('colvis', list(
    extend = 'collection',
    buttons = list(list(extend='csv',
    filename = 'results'),
    list(extend='excel',
    filename = 'results'),
    list(extend='pdf',
    filename= 'results')),
    text = 'Download'
    )),
    scrollX = TRUE,
    pageLength = 5,
    lengthMenu = list(c(5, 15, -1), list('5', '15', 'All'))
    ), rownames = FALSE
    )
    })



    }
    shinyApp(ui, server)


    (I am not sure it makes a difference in which order you apply the filter, maybe you can ellaborate on this if I am mistaken).






    share|improve this answer















    You can start by creating a selectInput() for all variables as well as add and remove buttons:



      output$potentialFilter <- renderUI({
    tagList(
    selectInput("createFilter", "Create Filter", names(my_data)),
    actionButton("remove", "remove"),
    actionButton("add", "add")
    )
    })


    And then you can create inputs for the selected variables.
    Note: As you dont want to reset the inserted UIs when you add new ones you should use insertUI() instead of renderUI().



      insertUI(selector = "#add", where = "afterEnd", 
    ui = selectizeInput(toBeIncluded, toBeIncluded, my_data[[toBeIncluded]],
    selected = my_data[[toBeIncluded]], multiple = TRUE)
    )


    Full example would read:



      library(shinydashboard)
    library(dplyr)
    library(shiny)
    library(DT)

    header <- dashboardHeader(title="Analysis and database")

    sidebar <- dashboardSidebar(
    sidebarMenu(
    # Setting id makes input$tabs give the tabName of currently-selected tab
    id = "sidebarmenu",
    menuItem("Database", tabName="db"),
    menuItem("Search by Name", tabName = "Filt_table"),
    uiOutput("potentialFilter"),
    uiOutput("rendFilter")
    )
    )

    body <- dashboardBody(

    tabItems(
    tabItem("db","table content",
    fluidRow(DT::dataTableOutput('tabla'))),
    tabItem("Filt_table","Filtered table content",
    fluidRow(DT::dataTableOutput('tablafilt')))
    )
    )

    ui <- dashboardPage(header, sidebar, body)

    ### SERVER SIDE

    server = function(input, output, session) {

    my_data <- data.frame(Person=c("Anne", "Pete", "Rose", "Julian", "Tristan", "Hugh"),
    Votes=c(10,25,56,89.36,78,1500),
    Stuff=c("test|3457678", "exterm|4567sdf", "1001(hom);4.3.4|3456", "xdfrtg", "1234|trsef|456(het)", "hyggas|tertasga"),
    letters=replicate(6, paste(sample(LETTERS,6, replace=T), collapse="")),
    stringsAsFactors = FALSE)

    global <- reactiveValues(filter = c(), filteredData = my_data, tagList = tagList())

    output$potentialFilter <- renderUI({
    tagList(
    selectInput("createFilter", "Create Filter", names(my_data)),
    actionButton("remove", "remove"),
    actionButton("add", "add")
    )
    })


    observeEvent(input$add, {
    global$filter <- c(global$filter, input$createFilter)
    toBeIncluded <- input$createFilter
    data <- my_data[[toBeIncluded]]
    if(typeof(data) == "double"){
    ui <- numericInput(toBeIncluded, toBeIncluded, ceiling(min(data)), min = min(data), max = max(data))
    }else if(typeof(data) == "character"){
    ui <- textAreaInput(toBeIncluded, toBeIncluded, data[1], width = "200px")
    }
    insertUI(selector = "#add", where = "afterEnd", ui = ui)
    })

    observeEvent(input$remove, {
    global$filter <- setdiff(global$filter, input$createFilter)
    removeUI(selector = paste0("div:has(> #", input$createFilter, ")"))
    })

    output$tabla <- DT::renderDataTable({
    DT::datatable(filtered())
    })

    filtered <- reactive({
    if(length(global$filter)){
    for(filterName in global$filter){
    if(is.character(input[[filterName]])){
    names <- unlist(strsplit(input[[filterName]], ";"))
    my_data <- my_data[my_data[[filterName]] %in% names, ]
    }else if(is.numeric(input[[filterName]])){
    my_data <- my_data[my_data[[filterName]] >= input[[filterName]], ]
    }
    }
    }
    return(my_data)
    })

    output$tablafilt <- DT::renderDataTable({
    DT::datatable(filtered(),
    filter = 'top',
    extensions = 'Buttons',
    options = list(
    dom = 'Blftip',
    buttons =
    list('colvis', list(
    extend = 'collection',
    buttons = list(list(extend='csv',
    filename = 'results'),
    list(extend='excel',
    filename = 'results'),
    list(extend='pdf',
    filename= 'results')),
    text = 'Download'
    )),
    scrollX = TRUE,
    pageLength = 5,
    lengthMenu = list(c(5, 15, -1), list('5', '15', 'All'))
    ), rownames = FALSE
    )
    })



    }
    shinyApp(ui, server)


    (I am not sure it makes a difference in which order you apply the filter, maybe you can ellaborate on this if I am mistaken).







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 22 at 21:17

























    answered Jan 9 at 16:30









    BigDataScientistBigDataScientist

    7,59231838




    7,59231838













    • thanks a lot for the answer, but the "desired" behaviour would be that filters are applied consecutively, i.e, if I apply a filter by "Person", and then a filter by "Votes", only the persons selected using Person filter would be filtered by vote. Now, if I click two "newly created" filters, the first is reset and the full table is displayed. Also, is there a way to use another option for selectizeInput, my real data has 20,000 rows and selectizeInput display all the options. If is too much question, the consecutive filter would be enough. Thanks

      – user2380782
      Jan 10 at 10:17











    • sry, i got sick. I might be able to take a look, later this week.

      – BigDataScientist
      Jan 14 at 20:09











    • Hope you feel better, no worries and thank you!!!

      – user2380782
      Jan 14 at 22:22











    • @BigSataScientist did you have a change to look to this question again?

      – user2380782
      Jan 18 at 8:54













    • left the bed again today ;) I made an update. I am not sure about your selectizeInput specification. Would you replace the selectInput("createFilter", "Create Filter", names(my_data)) (top of my post) with a text input or how would you approach the 20k row challenge?

      – BigDataScientist
      Jan 18 at 19:00



















    • thanks a lot for the answer, but the "desired" behaviour would be that filters are applied consecutively, i.e, if I apply a filter by "Person", and then a filter by "Votes", only the persons selected using Person filter would be filtered by vote. Now, if I click two "newly created" filters, the first is reset and the full table is displayed. Also, is there a way to use another option for selectizeInput, my real data has 20,000 rows and selectizeInput display all the options. If is too much question, the consecutive filter would be enough. Thanks

      – user2380782
      Jan 10 at 10:17











    • sry, i got sick. I might be able to take a look, later this week.

      – BigDataScientist
      Jan 14 at 20:09











    • Hope you feel better, no worries and thank you!!!

      – user2380782
      Jan 14 at 22:22











    • @BigSataScientist did you have a change to look to this question again?

      – user2380782
      Jan 18 at 8:54













    • left the bed again today ;) I made an update. I am not sure about your selectizeInput specification. Would you replace the selectInput("createFilter", "Create Filter", names(my_data)) (top of my post) with a text input or how would you approach the 20k row challenge?

      – BigDataScientist
      Jan 18 at 19:00

















    thanks a lot for the answer, but the "desired" behaviour would be that filters are applied consecutively, i.e, if I apply a filter by "Person", and then a filter by "Votes", only the persons selected using Person filter would be filtered by vote. Now, if I click two "newly created" filters, the first is reset and the full table is displayed. Also, is there a way to use another option for selectizeInput, my real data has 20,000 rows and selectizeInput display all the options. If is too much question, the consecutive filter would be enough. Thanks

    – user2380782
    Jan 10 at 10:17





    thanks a lot for the answer, but the "desired" behaviour would be that filters are applied consecutively, i.e, if I apply a filter by "Person", and then a filter by "Votes", only the persons selected using Person filter would be filtered by vote. Now, if I click two "newly created" filters, the first is reset and the full table is displayed. Also, is there a way to use another option for selectizeInput, my real data has 20,000 rows and selectizeInput display all the options. If is too much question, the consecutive filter would be enough. Thanks

    – user2380782
    Jan 10 at 10:17













    sry, i got sick. I might be able to take a look, later this week.

    – BigDataScientist
    Jan 14 at 20:09





    sry, i got sick. I might be able to take a look, later this week.

    – BigDataScientist
    Jan 14 at 20:09













    Hope you feel better, no worries and thank you!!!

    – user2380782
    Jan 14 at 22:22





    Hope you feel better, no worries and thank you!!!

    – user2380782
    Jan 14 at 22:22













    @BigSataScientist did you have a change to look to this question again?

    – user2380782
    Jan 18 at 8:54







    @BigSataScientist did you have a change to look to this question again?

    – user2380782
    Jan 18 at 8:54















    left the bed again today ;) I made an update. I am not sure about your selectizeInput specification. Would you replace the selectInput("createFilter", "Create Filter", names(my_data)) (top of my post) with a text input or how would you approach the 20k row challenge?

    – BigDataScientist
    Jan 18 at 19:00





    left the bed again today ;) I made an update. I am not sure about your selectizeInput specification. Would you replace the selectInput("createFilter", "Create Filter", names(my_data)) (top of my post) with a text input or how would you approach the 20k row challenge?

    – BigDataScientist
    Jan 18 at 19:00













    0














    You can always update your filters on the spot by using



    updateSelectInput and others



    https://shiny.rstudio.com/reference/shiny/0.13.2/updateSelectInput.html



    Best!






    share|improve this answer




























      0














      You can always update your filters on the spot by using



      updateSelectInput and others



      https://shiny.rstudio.com/reference/shiny/0.13.2/updateSelectInput.html



      Best!






      share|improve this answer


























        0












        0








        0







        You can always update your filters on the spot by using



        updateSelectInput and others



        https://shiny.rstudio.com/reference/shiny/0.13.2/updateSelectInput.html



        Best!






        share|improve this answer













        You can always update your filters on the spot by using



        updateSelectInput and others



        https://shiny.rstudio.com/reference/shiny/0.13.2/updateSelectInput.html



        Best!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 21 at 13:16









        LocoGrisLocoGris

        2,6001828




        2,6001828






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54025007%2flet-user-create-different-button-actions-in-shinydashboard-app%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

            Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

            A Topological Invariant for $pi_3(U(n))$