SubpopulationManager: Subpopulation Manager TidyModule

Description Format Input Output Super class Methods See Also Examples

Description

Provides module for creating and editing subpopulations.

Format

R6 class

Input

datalist

A list of data sets. Can be tibbles, data frames, etc. Expects them to have a common ID field (default is USUBJID)

options

The options for the module of type reactiveValues with values

subjectDs

If one of the data sets in datalist contains subject level data then provide it here. Default: ADSL

idvar

ID field that is common across all datasets in datalist. Default USUBJID

Output

populations

List of PopulationFilter S3 objects.

Super class

tidymodules::TidyModule -> SubpopulationManager

Methods

Public methods

Inherited methods

Method new()

Usage
SubpopulationManager$new(...)

Method ui()

Usage
SubpopulationManager$ui()

Method server()

Usage
SubpopulationManager$server(
  input,
  output,
  session,
  datalist = NULL,
  options = NULL
)

Method clone()

The objects of this class are cloneable with this method.

Usage
SubpopulationManager$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other tidymodules: Filter, SubgroupManager, Subgroup, Subpopulation, TTEMapping, TTE, TableListing, VariableSelection

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
## Not run: 
library(tidymodules)
library(subpat)
library(bs4Dash)

subpopmod <- SubpopulationManager$new(id = "subpopmodule")

ui <- tagList(
  shinyjs::useShinyjs(),
  bs4DashPage(
    sidebar = bs4DashSidebar(disable = TRUE),
    body = bs4DashBody(
      subpopmod$ui()
    )
  )
)

# Define server logic
server <- function(input, output) {
  datalist <- reactive({
    example_datasets
  })
  
  opts <- reactiveValues(
    subjectDs = "ADSL",
    idvar = "USUBJID"
  )
  
  subpopmod$callModule()
  
  observe({
    # Pass the data into the module
    datalist %>1% subpopmod
    
    # Add the options to the subpopulation manager
    opts %>2% subpopmod
  })
}

# Run the application 
shinyApp(ui = ui, server = server)

## End(Not run)

Novartis/subpat documentation built on April 11, 2020, 3:11 p.m.