match_week_xts: Match a specific week

View source: R/match_week_xts.r

match_week_xtsR Documentation

Match a specific week

Description

Create an indicator variable for a specific week.

Usage

match_week_xts(x_week, week_number, return_xts = FALSE)

Arguments

x_week

Numeric xts object with week of each observation.

week_number

Numeric scalar; Week of the year to match.

return_xts

Logical scalar; return matrix as an xts time series object. Default is FALSE.

Value

An indicator variable where the observation that matches the week entered = 1, 0 otherwise.

Examples

xmas_w53_xts <- match_week_xts(ic_week_xts, 53)

bcmonsell/airutilities documentation built on May 16, 2022, 3:23 p.m.