Learn R Programming

tsaux (version 1.0.0)

sampling_sequence: Sampling frequency sequence

Description

Given a sampling period, the function will return the proportion of units of that period in secs, mins, hours, days, weeks, months and years, but will return NA for periods of higher frequency i.e. for a period of days it will return NA for secs, mins and hours. The function serves as a helper for seasonal periodicity calculations.

Usage

sampling_sequence(period)

Value

A named numeric vector.

Arguments

period

the period returned by a call to the function sampling_frequency.

Author

Alexios Galanos

Examples

Run this code
w <- sampling_sequence(sampling_frequency(seq(as.Date("2010-01-01"),
as.Date("2011-01-01"), by="weeks")))
m <- sampling_sequence(sampling_frequency(seq(as.POSIXct("2010-01-01 12:00:00"),
as.POSIXct("2010-01-02 12:00:00"), by="15 mins")))

Run the code above in your browser using DataLab