Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

frequency

Replacing the Index of Objects


Description

Generic function for replacing the frequency of an object.

Usage

frequency(x) <- value

Arguments

x

an object.

value

a frequency.

Details

frequency<- is a generic function for replacing (or assigning) the frequency of an object. Currently, there is a "zooreg" and a "zoo" method. In both cases, the value is assigned to the "frequency" of the object if it complies with the index(x).

See Also

Examples

z <- zooreg(1:5)
z
as.ts(z)
frequency(z) <- 3
z
as.ts(z)

zoo

S3 Infrastructure for Regular and Irregular Time Series (Z's Ordered Observations)

v1.8-10
GPL-2 | GPL-3
Authors
Achim Zeileis [aut, cre] (<https://orcid.org/0000-0003-0918-3766>), Gabor Grothendieck [aut], Jeffrey A. Ryan [aut], Joshua M. Ulrich [ctb], Felix Andrews [ctb]
Initial release
2022-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.