Learn R Programming

meteor (version 0.4-5)

from: Date manipulation

Description

Helper functions for extracting information from dates. Or to create a Date from a day number.

Usage

fromDate(x, v)
fromYear(y, v)
fromDoy(doy, y)

Value

integer or Date

Arguments

x

Date or POSIX

y

integer (year)

v

character. Output variable. With fromDate it can be one of: "year", "month", "week", "day", "doy". With fromYear it can be one of "leap", "ndays", "days"

doy

integer (day of the year)

Examples

Run this code
d <- as.Date("1999-12-30") + 1:2
d
fromDate(d, "month")
fromDate(d, "doy")

fromDoy(10, 2000)

Run the code above in your browser using DataLab