StackYears: StackYears

View source: R/stackyears.R

StackYearsR Documentation

StackYears

Description

Stacks years to make seasonal patterns and growth easier to see.

Usage

StackYears(
  x,
  date = NULL,
  n.years = NULL,
  calendar = TRUE,
  period.number = FALSE,
  transpose = FALSE
)

Arguments

x

A vector, list, table. or data.frame.

date

An optional vector containing dates. Where not provided, the dates are assumed to be in the row or column names, first row or column, or first element of x.

n.years

The number of years to stack. Older data is ignored.

calendar

If true, the years are calendar. Otherwise, they end at the final time point. When this is done, some years can have different numbers of values (e.g., weeks).

period.number

If TRUE, period numbers instead of dates are returned in the column names.

transpose

If TRUE, the result is transposed.

Value

A matrix, with the column names containing the dates or time periods, and the rows the years.


NumbersInternational/flipTables documentation built on Feb. 26, 2024, 6:42 a.m.