Skip to contents

The StrataSettings class, encapsulating the age, gender and start-year + age breaks settings.

Value

A StrataSettings R6 object that stores the age, gender, year, and age-break stratification options used during analysis.

Note, when serializing with a library such as jsonlite, first call toList() on the R6 class before calling jsonlite::toJSON().

Details

This class is used to specify the stratification settings for an analysis. The settings can indicate the statistics should be grouped by the age, gender, or start year, and any combination of those selections.

Example: age = TRUE and gender = TRUE will produce statisics by age, by gender, and by age and gender.

Active bindings

byAge

enables stratification by age

byGender

enables stratification by gender

byYear

enables stratification by start year of TAR

ageBreaks

a list of age breaks with at least 1 member

ageBreakList

a list of age breaks

Methods


StrataSettings$new()

creates a new instance, using the provided data param if provided.

Usage

StrataSettings$new(data = list())

Arguments

data

the data (as a json string or list) to initialize with

Returns

A new StrataSettings object initialized from a list or JSON string.


StrataSettings$toList()

returns the R6 class elements as a list for use in jsonlite::toJSON()

Usage

StrataSettings$toList()

Returns

A named list containing the logical flags and age break lists used by the design.


StrataSettings$asJSON()

returns the JSON string for this R6 class

Usage

StrataSettings$asJSON()

Returns

A JSON string representation of the StrataSettings object.


StrataSettings$clone()

The objects of this class are cloneable with this method.

Usage

StrataSettings$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.