Learn R Programming

RMAWGEN (version 1.3.7)

findDate: Finds the date corresponding a row index of a matrix given the date (origin) of the first row

Description

Finds the date corresponding a row index of a matrix given the date (origin) of the first row

Usage

findDate(k, origin = "1961-1-1", data.frame = TRUE, decimal = FALSE,
  character = FALSE)

Arguments

k

integer or decimal value corresponding to number of days since origin

origin

origin date. See also extractdays

data.frame

logical variable. If TRUE (default) the date is returned as data frame (like data in extractyears), otherwise it is returned as character or POSIXct.

decimal

logical variable. If FALSE (default) k is integer and starts from 1, otherwise is consider as the decimal julian day since origin (deprecated)

character

logical variable. It is used if data.frame is FALSE, if it is FALSE, the date is returned as POSIXct, otherwise it is a character in the following form: YYYY-MM-DD

Value

the date(s) corresponding to k under different formats

See Also

date.mdy,extractdays

Examples

Run this code
# NOT RUN {
findDate <- findDate(100,origin="1961-1-1",data.frame=FALSE,character=TRUE)


# }

Run the code above in your browser using DataLab