jinseob2kim / jsmodule
Showing 1 of 4 files from the diff.
Other files ignored by Codecov
NEWS.md has changed.
DESCRIPTION has changed.
man/coxModule.Rd has changed.

@@ -44,6 +44,7 @@
Loading
44 44
#' @param default.unires Set default independent variables using univariate analysis.
45 45
#' @param limit.unires Change to default.unires = F if number of independent variables > limit.unires, Default: 20
46 46
#' @param id.cluster reactive cluster variable if marginal cox model, Default: NULL
47 +
#' @param ties.coxph 'coxph' ties option, one of 'efron', 'breslow', 'exact', default: 'erfon'
47 48
#' @return Shiny modulde server for Cox's model.
48 49
#' @details Shiny modulde server for Cox's model.
49 50
#' @examples
@@ -80,7 +81,7 @@
Loading
80 81
#' @importFrom purrr map_lgl
81 82
#' @importFrom survival cluster coxph Surv
82 83
83 -
coxModule <- function(input, output, session, data, data_label, data_varStruct = NULL, nfactor.limit = 10, design.survey = NULL, default.unires = T, limit.unires = 20, id.cluster = NULL) {
84 +
coxModule <- function(input, output, session, data, data_label, data_varStruct = NULL, nfactor.limit = 10, design.survey = NULL, default.unires = T, limit.unires = 20, id.cluster = NULL, ties.coxph = "efron") {
84 85
85 86
  ## To remove NOTE.
86 87
  data.cox.step <- level <- val_label <- variable <- NULL
@@ -205,10 +206,10 @@
Loading
205 206
                          function(v){
206 207
                            if (is.null(id.cluster)){
207 208
                              forms <- as.formula(paste("survival::Surv(", input$time_cox, ",", input$event_cox, ") ~ ", v, sep = ""))
208 -
                              coef <- tryCatch(summary(survival::coxph(forms, data = data.cox))$coefficients, error = function(e){return(NULL)})
209 +
                              coef <- tryCatch(summary(survival::coxph(forms, data = data.cox, ties = ties.coxph))$coefficients, error = function(e){return(NULL)})
209 210
                            } else{
210 211
                              forms <- as.formula(paste("survival::Surv(", input$time_cox, ",", input$event_cox, ") ~ ", v, " + cluster(", id.cluster(), ")", sep = ""))
211 -
                              coef <- tryCatch(summary(survival::coxph(forms, data = data.cox, robust = T))$coefficients, error = function(e){return(NULL)})
212 +
                              coef <- tryCatch(summary(survival::coxph(forms, data = data.cox, robust = T, ties = ties.coxph))$coefficients, error = function(e){return(NULL)})
212 213
                            }
213 214
                            sigOK <- ifelse(is.null(coef), F, !all(coef[, "Pr(>|z|)"] > 0.05))
214 215
                            return(sigOK)
@@ -382,9 +383,9 @@
Loading
382 383
383 384
    if (is.null(design.survey)){
384 385
      if (is.null(id.cluster)){
385 -
        cc <- substitute(survival::coxph(.form, data= data.cox, model = T), list(.form= form.cox()))
386 +
        cc <- substitute(survival::coxph(.form, data= data.cox, model = T, ties = .ties), list(.form= form.cox(), .ties = ties.coxph))
386 387
      } else{
387 -
        cc <- substitute(survival::coxph(.form, data= data.cox, model = T, robust = T), list(.form= form.cox()))
388 +
        cc <- substitute(survival::coxph(.form, data= data.cox, model = T, robust = T, ties = .ties), list(.form= form.cox(), .ties = ties.coxph))
388 389
      }
389 390
      res.cox <- eval(cc)
390 391
      if (input$step_check == T){
@@ -399,9 +400,9 @@
Loading
399 400
        data.cox.step <<- data.cox[complete.cases(data.cox[, .SD, .SDcols = c(input$time_cox, input$event_cox, input$indep_cox)])]
400 401
401 402
        if (is.null(id.cluster)){
402 -
          cc.step <- substitute(survival::coxph(.form, data= data.cox.step, model = T), list(.form= form.cox()))
403 +
          cc.step <- substitute(survival::coxph(.form, data= data.cox.step, model = T, ties = .ties), list(.form= form.cox(), .ties = ties.coxph))
403 404
        } else{
404 -
          cc.step <- substitute(survival::coxph(.form, data= data.cox.step, model = T, robust = T), list(.form= form.cox()))
405 +
          cc.step <- substitute(survival::coxph(.form, data= data.cox.step, model = T, robust = T, ties = .ties), list(.form= form.cox(), .ties = ties.coxph))
405 406
        }
406 407
407 408
        res.cox <- stats::step(eval(cc.step), direction = input$step_direction, scope = list(upper = scope[[1]], lower = scope[[2]]))
Files Coverage
R 6.34%
Project Totals (19 files) 6.34%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading