get.seq {tdata} | R Documentation |
Generate a Sequence from a Range of Frequencies
Description
Use this function to generate a list of character strings, where each element is a string representation of a frequency within the specified range.
Usage
get.seq(from, to, by = 1)
Arguments
from |
The first frequency of the sequence. |
to |
The last frequency of the sequence. |
by |
An integer that determines the increment of the sequence. |
Details
The two arguments from
and to
should be valid frequencies (see the f.?
functions).
They should also be consistent; you cannot create a sequence in which one is, for example, monthly and the other is yearly.
Value
A list of character strings that represents the sequence.
See Also
Examples
from <- f.monthly(2020,1)
to <- f.monthly(2021,12)
sequence1 <- get.seq(from, to, 1) # this will be '2020M1', '2020M2', ..., '2021M12'
sequence2 <- get.seq(from, to, 2) # this will be '2020M1', '2020M3', ..., '2021M11'
sequence3 <- get.seq(from, to, 3) # this will be '2020M1', '2020M4', ..., '2021M10'
# backward:
sequence4 <- get.seq(to, from, -1) # this will be '2021M12', '2021M11', ..., '2020M1'
[Package tdata version 0.3.0 Index]