codes {musica} | R Documentation |
Conversion between period specification and codes
Description
Conversion between period specification and codes
Usage
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
period2code(c('1 day', '23 days', '3 month', '2 years'))
code2period(c('D1', 'D23', 'M3', 'Y2'))
[Package musica version 0.1.3 Index]