Description Format Input Output Super class Methods See Also Examples
Shiny TidyModule create ad-hoc (non-validated) PDF table listings by data set and by subject.
R6 class
datalistA list of data sets. Can be tibbles, data frames, etc. Expects them to have a common ID field (default is USUBJID)
populationsA list of PopulationFilter
optionsThe options for the module of type reactiveValues with values
subjectDsIf one of the data sets in datalist contains subject level data then provide it here. Default: ADSL
idvarID field that is common across all datasets in datalist. Default USUBJID
No output is returned for this module.
tidymodules::TidyModule -> TableListing
new()TableListing$new(...)
ui()TableListing$ui()
server()TableListing$server( input, output, session, datalist = NULL, populations = NULL, options = NULL )
clone()The objects of this class are cloneable with this method.
TableListing$clone(deep = FALSE)
deepWhether to make a deep clone.
Other tidymodules:
Filter,
SubgroupManager,
Subgroup,
SubpopulationManager,
Subpopulation,
TTEMapping,
TTE,
VariableSelection
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 67 68 69 70 71 72 73 74 75 76 77 78 | ## Not run:
library(bs4Dash)
library(subpat)
library(tidymodules)
tableListMod <- TableListing$new()
example_datasets <- list(
"ADSL" = data.frame(
a = c("x", "z", "y", "x", "z", "x", "x", "y", "x", "y"),
b = c(29L, 4L, 15L, 28L, 41L, 25L, 41L, 15L, 6L, 17L),
USUBJID = as.character(seq_len(10)),
stringsAsFactors = FALSE
),
"ADAE" = data.frame(
a = c("x", "z", "y", "x", "z", "x", "x", "y", "x", "y"),
c = c(1, NA, NA, 1, 2, NA, NA, 4, 3, 1),
dates = seq(as.Date("2019-07-10"), as.Date("2019-08-12"), length.out = 10),
USUBJID = as.character(seq_len(10)),
stringsAsFactors = FALSE
)
)
# This is the output from dput on a PopulationFilter
# Use the Subpopulation to create them in a shiny application
example_populations <- list(
# Population 1
structure(list(dataset_names = c("ADSL", "ADAE"), filters = structure(list(
filter_1 = structure(
list(
dataset_name = "ADAE", variable = "c",
filterType = "numeric", includeMissing = FALSE, onlyMissing = FALSE,
createDate = "Fri Jul 26 18:44:11 2019", minVal = 1L, maxVal = 4L
),
.Names = c("dataset_name", "variable",
"filterType", "includeMissing", "onlyMissing", "createDate",
"minVal", "maxVal"),
class = "DatasetFilter")
),
.Names = "filter_1"
),
name = "New population: 1", createDate = "Fri Jul 26 18:44:05 2019",
editDate = "Fri Jul 26 18:44:13 2019"),
.Names = c("dataset_names", "filters", "name", "createDate", "editDate"),
class = "PopulationFilter")
)
ui <- tagList(
shinyjs::useShinyjs(),
bs4DashPage(
sidebar = bs4DashSidebar(disable = TRUE),
body = bs4DashBody(
tableListMod$ui()
)
)
)
# Define server logic
server <- function(input, output) {
opts <- reactiveValues(
idvar = "USUBJID"
)
tableListMod$callModule()
observe({
reactive(example_datasets) %>1% tableListMod
reactive(example_populations) %>2% tableListMod
opts %>3% tableListMod
})
}
# Run the application
shinyApp(ui = ui, server = server)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.