Learn R Programming

fame (version 1.03)

tif: Time Index Frequencies

Description

Return the tif code of an object, or the name associated with a tif code.

Usage

tif(x, ...)
## S3 method for class 'ti':
tif(x, \dots)
## S3 method for class 'tis':
tif(x, \dots)
## S3 method for class 'ts':
tif(x, \dots)
## S3 method for class 'default':
tif(x, freq = NULL, \dots)
tifName(s)
## S3 method for class 'default':
tifName(s)
## S3 method for class 'ti':
tifName(s)
## S3 method for class 'tis':
tifName(s)

Arguments

x
a ti or tis object, or a string giving a tif name.
freq
numeric. If x is missing, return the tif for this frequency, otherwise ignore.
...
ignored
s
a ti or tis object, or a tif code.

Value

  • tif returns the tif code for x, while tifName returns a name for that code. Many of the codes have several names, but only the default one is returned.

    tif or tifName called with no arguments returns a vector of all tif codes with names.

Details

The tifList object associates tifNames with tif codes. Most functions that call for tif argument can take either a tif code or a tif name.

Both function are generic function with methods for ti and tis objects, as well as a default method. tif also has a method for ts objects.

See Also

ti, frequency

Examples

Run this code
tif()                 ## returns a vector of all tif codes
tifName(today())      ## today() returns a ti

Run the code above in your browser using DataLab