Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zackbatist
Last active May 13, 2019 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zackbatist/c9ec13e00438afd6610b7244f69a0f8c to your computer and use it in GitHub Desktop.
Save zackbatist/c9ec13e00438afd6610b7244f69a0f8c to your computer and use it in GitHub Desktop.
#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