sampling_frequency: Infers the sampling frequency of a time series

View source: R/frequency.R

sampling_frequencyR Documentation

Infers the sampling frequency of a time series

Description

Given either a vector of time indices or an xts object will infer the sampling frequency.

Usage

sampling_frequency(x)

Arguments

x

either an xts object (or one which has an index attribute) else a vector of class Date or POSIX based time index

Value

the sampling period (character).

Examples

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


tsaux documentation built on April 4, 2025, 3:08 a.m.