Skip to content

Commit

Permalink
z
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseob2kim committed Mar 3, 2021
1 parent f3ccb08 commit dfb6adc
Show file tree
Hide file tree
Showing 18 changed files with 82 additions and 76 deletions.
4 changes: 2 additions & 2 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This package was submitted to CRAN on 2020-07-09.
Once it is accepted, delete this file and tag the release (commit 7c23b88a64).
This package was submitted to CRAN on 2021-02-15.
Once it is accepted, delete this file and tag the release (commit f3ccb08).
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: jsmodule
Title: 'RStudio' Addins and 'Shiny' Modules for Medical Research
Version: 1.1.6
Date: 2021-02-02
Version: 1.1.7
Date: 2021-03-03
Authors@R: c(person("Jinseob", "Kim", email = "jinseob2kim@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9403-605X")),
person("Zarathu", role = c("cph", "fnd"))
)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# jsmodule 1.1.7

## Bug fix

* Label info in subgroup analysis: regression, cox

# jsmodule 1.1.6

## Fix & update
Expand Down
12 changes: 6 additions & 6 deletions R/FilePsInput.R
Original file line number Diff line number Diff line change
Expand Up @@ -435,17 +435,17 @@ FilePs <- function(input, output, session, nfactor.limit = 20) {
out <- out[get(input$var_subset[[v]]) %in% input[[paste0("val_subset", v)]]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
} else{
out <- out[get(input$var_subset[[v]]) >= input[[paste0("val_subset", v)]][1] & get(input$var_subset[[v]]) <= input[[paste0("val_subset", v)]][2]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
}
}
Expand Down
12 changes: 6 additions & 6 deletions R/FileRepeatedInput.R
Original file line number Diff line number Diff line change
Expand Up @@ -381,17 +381,17 @@ FileRepeated <- function(input, output, session, nfactor.limit = 20) {
out <- out[get(input$var_subset[[v]]) %in% input[[paste0("val_subset", v)]]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
} else{
out <- out[get(input$var_subset[[v]]) >= input[[paste0("val_subset", v)]][1] & get(input$var_subset[[v]]) <= input[[paste0("val_subset", v)]][2]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
}
}
Expand Down
12 changes: 6 additions & 6 deletions R/FileSurveyInput.R
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ FileSurvey <- function(input, output, session, nfactor.limit = 20) {
# error = function(e){return(survey::svydesign(id = cluster.survey, strata = strata.survey, weights = weights.survey, data = out, nest = T))})
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
} else{
out <- out[get(input$var_subset[[v]]) >= input[[paste0("val_subset", v)]][1] & get(input$var_subset[[v]]) <= input[[paste0("val_subset", v)]][2]]
Expand All @@ -462,9 +462,9 @@ FileSurvey <- function(input, output, session, nfactor.limit = 20) {

#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
}
}
Expand Down
6 changes: 3 additions & 3 deletions R/coxph.R
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ coxModule <- function(input, output, session, data, data_label, data_varStruct =
}

data.cox[, (vlist()$factor_vars) := lapply(.SD, factor), .SDcols = vlist()$factor_vars]
label.regress2 <- mk.lev(data.cox)[, c("variable", "class", "level")]
data.table::setkey(data_label(), "variable", "class", "level")
data.table::setkey(label.regress2, "variable", "class", "level")
label.regress2 <- mk.lev(data.cox)[, c("variable", "level")]
data.table::setkey(data_label(), "variable", "level")
data.table::setkey(label.regress2, "variable", "level")
label.regress <- data_label()[label.regress2]
data.cox[[input$event_cox]] <- as.numeric(as.vector(data.cox[[input$event_cox]]))

Expand Down
12 changes: 6 additions & 6 deletions R/csvFileInput.R
Original file line number Diff line number Diff line change
Expand Up @@ -377,17 +377,17 @@ csvFile <- function(input, output, session, nfactor.limit = 20) {
out <- out[get(input$var_subset[[v]]) %in% input[[paste0("val_subset", v)]]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
} else{
out <- out[get(input$var_subset[[v]]) >= input[[paste0("val_subset", v)]][1] & get(input$var_subset[[v]]) <= input[[paste0("val_subset", v)]][2]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
}
}
Expand Down
12 changes: 6 additions & 6 deletions R/gee.R
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ GEEModuleLinear <- function(input, output, session, data, data_label, data_varSt
}
}
data.regress[, (vlist()$factor_vars) := lapply(.SD, factor), .SDcols = vlist()$factor_vars]
label.regress2 <- mk.lev(data.regress)[, c("variable", "class", "level")]
data.table::setkey(data_label(), "variable", "class", "level")
data.table::setkey(label.regress2, "variable", "class", "level")
label.regress2 <- mk.lev(data.regress)[, c("variable", "level")]
data.table::setkey(data_label(), "variable", "level")
data.table::setkey(label.regress2, "variable", "level")
label.regress <- data_label()[label.regress2]
}
y <- input$dep_vars
Expand Down Expand Up @@ -518,9 +518,9 @@ GEEModuleLogistic <- function(input, output, session, data, data_label, data_var
}
}
data.logistic[, (vlist()$factor_vars) := lapply(.SD, factor), .SDcols = vlist()$factor_vars]
label.regress2 <- mk.lev(data.logistic)[, c("variable", "class", "level")]
data.table::setkey(data_label(), "variable", "class", "level")
data.table::setkey(label.regress2, "variable", "class", "level")
label.regress2 <- mk.lev(data.logistic)[, c("variable", "level")]
data.table::setkey(data_label(), "variable", "level")
data.table::setkey(label.regress2, "variable", "level")
label.regress <- data_label()[label.regress2]
}
y <- input$dep_vars
Expand Down
12 changes: 6 additions & 6 deletions R/jsBasicGadget.R
Original file line number Diff line number Diff line change
Expand Up @@ -374,17 +374,17 @@ jsBasicGadget <- function(data, nfactor.limit = 20) {
out <- out[get(input$var_subset[[v]]) %in% input[[paste0("val_subset", v)]]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
} else{
out <- out[get(input$var_subset[[v]]) >= input[[paste0("val_subset", v)]][1] & get(input$var_subset[[v]]) <= input[[paste0("val_subset", v)]][2]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
}
}
Expand Down
12 changes: 6 additions & 6 deletions R/jsPropensityGadget.R
Original file line number Diff line number Diff line change
Expand Up @@ -504,18 +504,18 @@ jsPropensityGadget <- function(data, nfactor.limit = 20){
out1 <- out1[get(input$var_subset[[v]]) %in% input[[paste0("val_subset", v)]]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out1[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out1)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out1)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]

} else{
out1 <- out1[get(input$var_subset[[v]]) >= input[[paste0("val_subset", v)]][1] & get(input$var_subset[[v]]) <= input[[paste0("val_subset", v)]][2]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out1[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out1)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out1)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
}
}
Expand Down
12 changes: 6 additions & 6 deletions R/jsRepeatedGadget.R
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,17 @@ jsRepeatedGadjet <- function(data, nfactor.limit = 20) {
out <- out[get(input$var_subset[[v]]) %in% input[[paste0("val_subset", v)]]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
} else{
out <- out[get(input$var_subset[[v]]) >= input[[paste0("val_subset", v)]][1] & get(input$var_subset[[v]]) <= input[[paste0("val_subset", v)]][2]]
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
}
}
Expand Down
12 changes: 6 additions & 6 deletions R/jsSurveyGadget.R
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ jsSurveyGadget <- function(data, nfactor.limit = 20) {
# error = function(e){return(survey::svydesign(id = cluster.survey, strata = strata.survey, weights = weights.survey, data = out, nest = T))})
#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
} else{
out <- out[get(input$var_subset[[v]]) >= input[[paste0("val_subset", v)]][1] & get(input$var_subset[[v]]) <= input[[paste0("val_subset", v)]][2]]
Expand All @@ -454,9 +454,9 @@ jsSurveyGadget <- function(data, nfactor.limit = 20) {

#var.factor <- c(data()$factor_original, input$factor_vname)
out[, (var.factor) := lapply(.SD, factor), .SDcols = var.factor]
out.label2 <- mk.lev(out)[, c("variable", "class", "level")]
data.table::setkey(out.label, "variable", "class", "level")
data.table::setkey(out.label2, "variable", "class", "level")
out.label2 <- mk.lev(out)[, c("variable", "level")]
data.table::setkey(out.label, "variable", "level")
data.table::setkey(out.label2, "variable", "level")
out.label <- out.label[out.label2]
}
}
Expand Down
6 changes: 3 additions & 3 deletions R/kaplan.R
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,9 @@ kaplanModule <- function(input, output, session, data, data_label, data_varStruc
}

data.km[, (vlist()$factor_vars) := lapply(.SD, factor), .SDcols = vlist()$factor_vars]
label.regress2 <- mk.lev(data.km)[, c("variable", "class", "level")]
data.table::setkey(data_label(), "variable", "class", "level")
data.table::setkey(label.regress2, "variable", "class", "level")
label.regress2 <- mk.lev(data.km)[, c("variable", "level")]
data.table::setkey(data_label(), "variable", "level")
data.table::setkey(label.regress2, "variable", "level")
label.regress <- data_label()[label.regress2]
data.km[[input$event_km]] <- as.numeric(as.vector(data.km[[input$event_km]]))

Expand Down
6 changes: 3 additions & 3 deletions R/regress.R
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ regressModule2 <- function(input, output, session, data, data_label, data_varStr
}

data.regress[, (vlist()$factor_vars) := lapply(.SD, factor), .SDcols = vlist()$factor_vars]
label.regress2 <- mk.lev(data.regress)[, c("variable", "class", "level")]
data.table::setkey(data_label(), "variable", "class", "level")
data.table::setkey(label.regress2, "variable", "class", "level")
label.regress2 <- mk.lev(data.regress)[, c("variable", "level")]
data.table::setkey(data_label(), "variable", "level")
data.table::setkey(label.regress2, "variable", "level")
label.regress <- data_label()[label.regress2]
}
mf <- model.frame(form, data.regress)
Expand Down
6 changes: 3 additions & 3 deletions R/roc.R
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,9 @@ rocModule <- function(input, output, session, data, data_label, data_varStruct =


data.roc[, (vlist()$factor_vars) := lapply(.SD, factor), .SDcols = vlist()$factor_vars]
label.regress2 <- mk.lev(data.roc)[, c("variable", "class", "level")]
data.table::setkey(data_label(), "variable", "class", "level")
data.table::setkey(label.regress2, "variable", "class", "level")
label.regress2 <- mk.lev(data.roc)[, c("variable", "level")]
data.table::setkey(data_label(), "variable", "level")
data.table::setkey(label.regress2, "variable", "level")
label.regress <- data_label()[label.regress2]
data.roc[[input$event_roc]] <- as.numeric(as.vector(data.roc[[input$event_roc]]))
}
Expand Down
6 changes: 3 additions & 3 deletions R/scatter.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ scatterServer <- function(id, data, data_label, data_varStruct = NULL, nfactor.l
}

data[, (vlist()$factor_vars) := lapply(.SD, factor), .SDcols = vlist()$factor_vars]
label2 <- mk.lev(data)[, c("variable", "class", "level")]
data.table::setkey(label, "variable", "class", "level")
data.table::setkey(label2, "variable", "class", "level")
label2 <- mk.lev(data)[, c("variable", "level")]
data.table::setkey(label, "variable", "level")
data.table::setkey(label2, "variable", "level")
label <- label[label2]

}
Expand Down
6 changes: 3 additions & 3 deletions R/timeroc.R
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,9 @@ timerocModule <- function(input, output, session, data, data_label, data_varStru
}
}
data.km[, (vlist()$factor_vars) := lapply(.SD, factor), .SDcols = vlist()$factor_vars]
label.regress2 <- mk.lev(data.km)[, c("variable", "class", "level")]
data.table::setkey(data_label(), "variable", "class", "level")
data.table::setkey(label.regress2, "variable", "class", "level")
label.regress2 <- mk.lev(data.km)[, c("variable", "level")]
data.table::setkey(data_label(), "variable", "level")
data.table::setkey(label.regress2, "variable", "level")
label.regress <- data_label()[label.regress2]
data.km[[input$event_km]] <- as.numeric(as.vector(data.km[[input$event_km]]))
}
Expand Down

0 comments on commit dfb6adc

Please sign in to comment.