Learn R Programming

icesTAF (version 3.6.0)

period: Period

Description

Paste two years to form a period string.

Usage

period(x, y = NULL)

Value

A string of the form "1990-2000".

Arguments

x

the first year, vector of years, matrix, or data frame.

y

the last year, if x is only the first year.

Details

If x is a vector or a data frame, then the lowest and highest years are used, and y is ignored.

If x is a matrix or data frame, this function looks for years in the first column. If the values of the first column do not look like years (four digits), then it looks for years in the row names.

See Also

paste is the underlying function to paste strings.

draft.data has an argument called period.

icesTAF-package gives an overview of the package.

Examples

Run this code
period(1963, 1970)
period(c(1963, 1970))
period(1963:1970)

period(range(catage.taf$Year))
period(catage.taf$Year)
period(catage.taf)
period(catage.xtab)
period(catage.long)

Run the code above in your browser using DataLab