Dates

0th

Percentile

Date Class

Description of the class "Date" representing calendar dates.

Keywords
utilities, chron
Usage
# S3 method for Date
summary(object, digits = 12, …)

Arguments
object

a Date object to be summarized.

digits

Number of significant digits for the computations.

Further arguments to be passed from or to other methods.

Details

Dates are represented as the number of days since 1970-01-01, with negative values for earlier dates. They are always printed following the rules of the current Gregorian calendar, even though that calendar was not in use long ago (it was adopted in 1752 in Great Britain and its colonies).

It is intended that the date should be an integer, but this is not enforced in the internal representation. Fractional days will be ignored when printing. It is possible to produce fractional days via the mean method or by adding or subtracting (see Ops.Date).

The print methods respect options("max.print").

See Also

Sys.Date for the current date.

Ops.Date for operators on "Date" objects.

format.Date for conversion to and from character strings.

axis.Date and hist.Date for plotting.

weekdays for convenience extraction functions.

seq.Date, cut.Date, round.Date for utility operations.

DateTimeClasses for date-time classes.

Aliases
  • Date
  • Dates
  • print.Date
  • summary.Date
  • Math.Date
  • Summary.Date
  • [.Date
  • [<-.Date
  • length<-.Date
  • [[.Date
  • as.data.frame.Date
  • as.list.Date
  • c.Date
  • mean.Date
  • split.Date
Examples
library(base) # NOT RUN { (today <- Sys.Date()) format(today, "%d %b %Y") # with month as a word (tenweeks <- seq(today, length.out=10, by="1 week")) # next ten weeks weekdays(today) months(tenweeks) (Dls <- as.Date(.leap.seconds)) ## length(<Date>) <- n now works ls <- Dls; length(ls) <- 12 l2 <- Dls; length(l2) <- 5 + length(Dls) stopifnot(exprs = { ## length(.) <- * is compatible to subsetting/indexing: identical(ls, Dls[seq_along(ls)]) identical(l2, Dls[seq_along(l2)]) ## has filled with NA's is.na(l2[(length(Dls)+1):length(l2)]) }) # }
Documentation reproduced from package base, version 3.5.1, License: Part of R 3.5.1

Community examples

Looks like there are no examples yet.