From 7f9b89dbdfeeb7e0b4aeb258357d1d0688856f4a Mon Sep 17 00:00:00 2001 From: Emily Beylerian Date: Thu, 23 Jul 2015 16:14:44 -0700 Subject: [PATCH] still using preconstructed vectors for cug terms (#47) --- inst/shiny/global.R | 2 +- inst/shiny/server.R | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/inst/shiny/global.R b/inst/shiny/global.R index 46e7527..6869408 100644 --- a/inst/shiny/global.R +++ b/inst/shiny/global.R @@ -46,7 +46,7 @@ splitargs <- function(searchterm, nw){ dups <- duplicated(termnames) termargs <- termargs[-which(dups)] termnames <- unique(termnames) - list(termnames, termargs) + list(names = termnames, args = termargs) } diff --git a/inst/shiny/server.R b/inst/shiny/server.R index 0a4f33a..715b7d5 100644 --- a/inst/shiny/server.R +++ b/inst/shiny/server.R @@ -2117,7 +2117,9 @@ output$dynamiccugterm <- renderUI({ } else { choices <- c("density", "concurrent", "isolates", "mean degree" = "meandeg") } - selectInput("cugtestterm", label = "Model term", + #matchingterms <- splitargs(nw = nw()) + #choices <- matchingterms$names[matchingterms$args == "()"] + selectizeInput("cugtestterm", label = "Model term", choices = choices) }) outputOptions(output, 'dynamiccugterm', suspendWhenHidden = FALSE) @@ -2777,10 +2779,10 @@ output$listofterms <- renderUI({ return() } if(state$allterms){ - current.terms <- allterms[[1]] + current.terms <- allterms$names } else { matchterms <- splitargs(nw = nw()) - current.terms <- matchterms[[1]] + current.terms <- matchterms$names } selectizeInput('chooseterm', label = NULL, choices = c("Select a term" = "", current.terms))