CFfactor_coverage: Coverage of time elements for each factor level

View source: R/api.R

CFfactor_coverageR Documentation

Coverage of time elements for each factor level

Description

This function calculates the number of time elements, or the relative coverage, in each level of a factor generated by CFfactor().

Usage

CFfactor_coverage(t, f, coverage = "absolute")

Arguments

t

An instance of CFTime.

f

factor or list. A factor or a list of factors derived from the parameter t. The factor or list thereof should generally be generated by the function CFfactor().

coverage

"absolute" or "relative".

Value

If f is a factor, a numeric vector with a length equal to the number of levels in the factor, indicating the number of units from the time series in t contained in each level of the factor when coverage = "absolute" or the proportion of units present relative to the maximum number when coverage = "relative". If f is a list of factors, a list with each element a numeric vector as above.

Examples

t <- CFtime("days since 2001-01-01", "365_day", 0:364)
f <- CFfactor(t, "dekad")
CFfactor_coverage(t, f, "absolute")

CFtime documentation built on April 12, 2025, 5:07 p.m.