helpers_dca_rdca: Internal Helper Functions for 'dca0()', 'dca()', and 'rdca()'

helpers_dca_rdcaR Documentation

Internal Helper Functions for dca0(), dca(), and rdca()

Description

[Stable]

Internal utility functions used by dca0(), dca(), and rdca() that perform operations on sets of domain–strata indices and manage the mapping between strata and domains.

Usage

H_cnt2dind(H_counts)

H_cnt2glbidx(H_counts)

H_get_strata_indices(H_counts, d)

Arguments

H_counts

(integerish)
strata counts in each domain.

d

(integerish(1)) domain index. Must satisfy ⁠0 < d <= length(H_counts)⁠.

Functions

  • H_cnt2dind(): Creates a vector of domain indicators from a vector of strata counts per domain; each element of the vector is the index of the domain to which the corresponding stratum belongs.

  • H_cnt2glbidx(): Creates unique indices for strata across multiple domains. Returns a list of integer vectors, where the d-th element contains the unique indices of the strata in domain d.

  • H_get_strata_indices(): Get the globally unique indices of strata belonging to a specific domain.

Note

These functions are internal and should typically not be called directly by users.

Examples

H_counts <- c(2, 2, 3) # three domains with 2, 2, and 3 strata respectively

# internal functions (not exported) – examples skipped
## Not run: 
H_cnt2dind(H_counts) # 1 1 2 2 3 3 3

## End(Not run)

# internal functions (not exported) – examples skipped
## Not run: 
H_cnt2glbidx(H_counts)

## End(Not run)

# internal functions (not exported) – examples skipped
## Not run: 
H_get_strata_indices(H_counts, 3) # 5 6 7

## End(Not run)


stratallo documentation built on March 12, 2026, 5:06 p.m.