sfreq: Sampling Frequency

Description Usage Arguments Value Author(s) See Also Examples

View source: R/sfreq.R

Description

This function identifies the sampling frequency of a zoo object. So far, it only works with daily/monthly/annual ts.

Usage

1
sfreq(x, min.year = 1800)

Arguments

x

variable of type zoo, xts or ts, with AT LEAST 2 elements, AND with a daily, monthly or annual sampling frequency.

min.year

integer used for a correct identification of the sampling frequency when x is an annual time series.

Value

Character. Possible values are:
-) daily : indicating that the sampling frequency in x is daily
-) monthly : indicating that the sampling frequency in x is monthly
-) annual : indicating that the sampling frequency in x is annual

Author(s)

Mauricio Zambrano-Bigiarini, mzb.devel@gmail

See Also

frequency

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Loading temperature data ##
## Loading daily streamflows at the station Oca en Ona (Ebro River basin, Spain) ##
data(OcaEnOnaQts)
d <- OcaEnOnaQts

## Daily to Monthly
m <- daily2monthly(d, FUN=mean, na.rm=TRUE)

## Daily to Annual
a <- daily2annual(d, FUN=mean, na.rm=TRUE)

# Daily zoo object
sfreq(d)

# Monthly zoo object
sfreq(m)

# Annual zoo object
sfreq(a)

hydroTSM documentation built on March 13, 2020, 2:23 a.m.