coxModule: coxModule: shiny modulde server for Cox's model.

Description Usage Arguments Details Value Examples

View source: R/coxph.R

Description

Shiny modulde server for Cox's model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
coxModule(
  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"
)

Arguments

input

input

output

output

session

session

data

reactive data

data_label

reactuve data label

data_varStruct

reactive list of variable structure, Default: NULL

nfactor.limit

nlevels limit in factor variable, Default: 10

design.survey

reactive survey data. default: NULL

default.unires

Set default independent variables using univariate analysis.

limit.unires

Change to default.unires = F if number of independent variables > limit.unires, Default: 20

id.cluster

reactive cluster variable if marginal cox model, Default: NULL

ties.coxph

'coxph' ties option, one of 'efron', 'breslow', 'exact', default: 'erfon'

Details

Shiny modulde server for Cox's model.

Value

Shiny modulde server for Cox's model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
library(shiny);library(DT);library(data.table);library(jstable)
ui <- fluidPage(
   sidebarLayout(
   sidebarPanel(
     coxUI("cox")
   ),
   mainPanel(
     DTOutput("coxtable")
   )
 )
)

server <- function(input, output, session) {

  data <- reactive(mtcars)
  data.label <- reactive(jstable::mk.lev(mtcars))

  out_cox <- callModule(coxModule, "cox", data = data, data_label = data.label,
                           data_varStruct = NULL)

  output$coxtable <- renderDT({
    datatable(out_cox()$table, rownames=T, caption = out_cox()$caption)
  })
}

Example output

Registered S3 method overwritten by 'GGally':
  method from   
  +.gg   ggplot2
Registered S3 methods overwritten by 'lme4':
  method                          from
  cooks.distance.influence.merMod car 
  influence.merMod                car 
  dfbeta.influence.merMod         car 
  dfbetas.influence.merMod        car 

Attaching package:DTThe following objects are masked frompackage:shiny:

    dataTableOutput, renderDataTable

jsmodule documentation built on Oct. 11, 2021, 9:07 a.m.