Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#QueryInputs is a list or dataframe containing selectInput values
#We would just have to update the QueryInputs object and then re-run QueryResults to refresh the output and regenerate the table (I hope)
QueryResults <- function(QueryInputs) {
Level2 <- dbReadTable(pool, 'level2')
filtered <- Level2
if (!is.null(QueryInputs$Locus)) {
filtered <- filtered %>% filter(Locus %in% QueryInputs$Locus)
}
if (!is.null(QueryInputs$Blank)) {
filtered <- filtered %>% filter(Blank %in% QueryInputs$Blank)
}
if (!is.null(QueryInputs$Modification)) {
filtered <- filtered %>% filter(Modification %in% QueryInputs$Modification)
}
if (!is.null(QueryInputs$Period)) {
filtered <- filtered %>% filter(Period %in% QueryInputs$Period)
}
filtered
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment