codes: Conversion between period specification and codes

Description Usage Arguments Details Examples

Description

Conversion between period specification and codes

Usage

1
2
3
period2code(periods)

code2period(code)

Arguments

periods

period specification

code

period code

Details

Periods are specified using keywords "day", "month", "year" preceded by an integer and a space and optionally followed by "s" (the specification is further passed to cut.Date, see cut.Date for details). To fit in figures and for simplicity, periods can be also specified by codes, i.e. by D, M, Y (for "day", "month" and "year", respectively) and folowed by integer specifying the number of intervals. The functions period2code and code2period provide conversion between the two alternatives.

Examples

1
2
3
period2code(c('1 day', '23 days', '3 month', '2 years'))

code2period(c('D1', 'D23', 'M3', 'Y2'))

hanel/musica documentation built on May 17, 2019, 2:28 p.m.