Subgroup module creates derived variables based on numeric variables.

Subgroup module creates derived variables based on numeric variables.

Format

R6 class

Input

data

A data set (data frame, tibble, etc.) to create subgroups from.

mapping

A mapping (reactive list) for 'parameter', and 'parameter_value' variables

parameter

The parameter values (PARAM). If this is provided then parameter_value must be provided as well. Will only perform the analysis where parameter == parameter_value

parameter_value

See the description for parameter

options

The options for the module of type reactiveValues with values

showLabels

Boolean: Do you want the variable labels to show? Generally from haven::read_sas or Hmisc::labels

isvar

Boolean: should we show the id variable selector?

Output

subgroups

List of each of the subgroups. Can call as.data.frame on the returned subgroups to create a data frame

See also

Super class

tidymodules::TidyModule -> SubgroupManager

Methods

Public methods

Inherited methods

Method new()

Usage

SubgroupManager$new(...)


Method ui()

Usage

SubgroupManager$ui()


Method server()

Usage

SubgroupManager$server(input, output, session)


Method clone()

The objects of this class are cloneable with this method.

Usage

SubgroupManager$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { library(shiny) library(subpat) library(bs4Dash) library(tidymodules) subgroupManagerModule <- SubgroupManager$new() ui <- tagList( shinyjs::useShinyjs(), bs4DashPage( sidebar = bs4DashSidebar(disable = TRUE), body = bs4DashBody( subgroupManagerModule$ui(), verbatimTextOutput('subgroupSummary') ) ) ) server <- function(input, output, session) { subgroupManagerModule$callModule() observe({ reactive(mtcars) %>1% subgroupManagerModule }) output$subgroupSummary <- renderPrint({ print("Subgroups:") print(summary(subgroupManagerModule$getOutput("subgroups")())) }) } }