Skip to content

Commit

Permalink
correct order of importance-vector/combs in case >= 10 cat. key vars …
Browse files Browse the repository at this point in the history
…have been specified
  • Loading branch information
bernhard-da committed Dec 19, 2017
1 parent 70ff916 commit 93ead57
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions inst/shiny/sdcApp/controllers/ui_categorical.R
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ kAnon_impvec <- reactive({
if (length(cn)==0) {
return(c(""))
}

# we need to sort the inputs properly
# in case >= 10 key vars have been specified
ii <- as.numeric(sapply(strsplit(cn, "_"), tail, 1))
cn <- cn[order(ii)]
vals <- unlist(lapply(cn, function(x) {
input[[x]]
}))
Expand All @@ -286,11 +291,17 @@ kAnon_comb_params <- reactive({
if (length(cn1)==0) {
return(NULL)
}

# we need to sort the inputs properly
# in case >= 10 key vars have been specified
ii <- as.numeric(sapply(strsplit(cn1, "_"), tail, 1))
cn1 <- cn1[order(ii)]
vals1 <- unlist(lapply(cn1, function(x) {
input[[x]]
}))

cn2 <- cn[grep("sl_kanon_combs_", cn)]
cn2 <- cn2[order(ii)]
vals2 <- unlist(lapply(cn2, function(x) {
input[[x]]
}))
Expand Down

0 comments on commit 93ead57

Please sign in to comment.