timerocModule: timerocModule: shiny module server for time-dependent roc...

Description Usage Arguments Details Value See Also Examples

View source: R/timeroc.R

Description

shiny module server for time-dependent roc analysis

shiny module server for time-dependent roc analysis- input number of model as integer

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
timerocModule(
  input,
  output,
  session,
  data,
  data_label,
  data_varStruct = NULL,
  nfactor.limit = 10,
  design.survey = NULL,
  id.cluster = NULL,
  iid = T,
  NRIIDI = T
)

timerocModule2(
  input,
  output,
  session,
  data,
  data_label,
  data_varStruct = NULL,
  nfactor.limit = 10,
  design.survey = NULL,
  id.cluster = NULL,
  iid = T,
  NRIIDI = T
)

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

id.cluster

Reactive cluster variable if marginal model, Default: NULL

iid

logical, get CI of AUC, Default: T

NRIIDI

logical, get NRI & IDI, Default: T

Details

shiny module server for time-dependent roc analysis

shiny module server for time dependent roc analysis- input number of model as integer

Value

shiny module server for time-dependent roc analysis

shiny module server for time dependent roc analysis- input number of model as integer

See Also

quantile setkey data.table rbindlist

quantile setkey data.table rbindlist

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
library(shiny);library(DT);library(data.table);library(jstable);library(ggplot2)
library(timeROC);library(survIDINRI)
ui <- fluidPage(
   sidebarLayout(
   sidebarPanel(
     timerocUI("timeroc")
   ),
   mainPanel(
     plotOutput("plot_timeroc"),
     ggplotdownUI("timeroc"),
     DTOutput("table_timeroc")
   )
 )
)

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

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

  out_timeroc <- callModule(timerocModule, "timeroc", data = data, data_label = data.label,
                            data_varStruct = NULL)

  output$plot_timeroc <- renderPlot({
    print(out_timeroc()$plot)
  })

  output$table_timeroc <- renderDT({
    datatable(out_timeroc()$tb, rownames=F, editable = F, extensions= "Buttons",
              caption = "ROC results",
              options = c(jstable::opt.tbreg("roctable"), list(scrollX = TRUE)))
  })
}
library(shiny);library(DT);library(data.table);library(jstable);library(ggplot2)
library(timeROC);library(survIDINRI)
ui <- fluidPage(
   sidebarLayout(
   sidebarPanel(
     timerocUI("timeroc")
   ),
   mainPanel(
     plotOutput("plot_timeroc"),
     ggplotdownUI("timeroc"),
     DTOutput("table_timeroc")
   )
 )
)

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

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

  out_timeroc <- callModule(timerocModule2, "timeroc", data = data, data_label = data.label,
                            data_varStruct = NULL)

  output$plot_timeroc <- renderPlot({
    print(out_timeroc()$plot)
  })

  output$table_timeroc <- renderDT({
    datatable(out_timeroc()$tb, rownames=F, editable = F, extensions= "Buttons",
              caption = "ROC results",
              options = c(jstable::opt.tbreg("roctable"), list(scrollX = TRUE)))
  })
}

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