hhh4contacts (version 0.13.1)

stratum: Extract Strata

Description

Methods to extract strata information from an object. Here we only define a method for class "sts".

Usage

stratum(x, ...)

# S4 method for sts stratum(x, which = NULL, ...)

Value

a character vector of strata names of length ncol(x).

Arguments

x

an object of class "sts".

...

further arguments passed to methods.

which

an integer (strata dimension) or NULL (to get the plain colnames, the default).

Methods (by class)

  • sts: Extract the names of the units, i.e., the colnames, from a multivariate "sts" object. If the units result from the interaction of multiple strata separated by dots, e.g., "region.group", the function can also extract the names corresponding to a specific strata dimension, e.g., which = 2 to get the group names.

Examples

Run this code
noroBEall <- noroBE(by = "all", flatten = TRUE)
stratum(noroBEall)  # just colnames(noroBEall)
stratum(noroBEall, which = 2)  # the age groups

Run the code above in your browser using DataCamp Workspace