friction_period: Friction period lookup (days/weeks; 1-year or 5-year average)

View source: R/friction_period.R

friction_periodR Documentation

Friction period lookup (days/weeks; 1-year or 5-year average)

Description

[Experimental] Return friction periods from the internal CBS-based table.

Usage

friction_period(
  year = NULL,
  units = "weeks",
  avg = "5yr",
  output = c("tibble", "value"),
  data = tatooheene::df_fp
)

Arguments

year

Integer vector of years to return. If NULL, returns all years.

units

One or more of c("days","weeks"). Default: "weeks".

avg

One or more of c("1yr","5yr"). Default: "5yr".

output

Either "tibble" (default) or "value". If "value", you must request exactly one year and one ⁠(units, avg)⁠ combo.

data

Data source (mainly for testing); default is tatooheene::df_fp.

Value

A tibble when output = "tibble", or a single numeric when output = "value".

Examples

# All years, 5-year average in weeks (default)
friction_period()

# Specific year (2019), weeks 5-year average
friction_period(year = 2019)

# Days (1-year) for multiple years
friction_period(year = 2018:2020, units = "days", avg = "1yr")

# Single numeric value (requires one year + one combo)
friction_period(year = 2019, units = "weeks", avg = "5yr", output = "value")


tatooheene documentation built on Dec. 15, 2025, 5:06 p.m.