File: DateTimeUpdate.Rd

package info (click to toggle)
r-cran-lubridate 1.7.4-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,952 kB
  • sloc: cpp: 3,329; ansic: 714; sh: 22; makefile: 2
file content (48 lines) | stat: -rw-r--r-- 1,682 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/update.r
\name{DateTimeUpdate}
\alias{DateTimeUpdate}
\alias{update.POSIXt}
\title{Changes the components of a date object}
\usage{
\method{update}{POSIXt}(object, ..., roll = FALSE,
  week_start = getOption("lubridate.week.start", 7), simple = NULL)
}
\arguments{
\item{object}{a date-time object}

\item{...}{named arguments: years, months, ydays, wdays, mdays, days, hours,
minutes, seconds, tzs (time zone compnent)}

\item{roll}{logical. If \code{TRUE}, and the resulting date-time lands on a
non-existent civil time instant (DST, 29th February, etc.) roll the date
till next valid point. When \code{FALSE}, the default, produce NA for non
existing date-times.}

\item{week_start}{week starting day (Default is 7, Sunday). Set
\code{lubridate.week.start} option to control this.}

\item{simple}{logical. Deprecated. Same as \code{roll}.}
}
\value{
a date object with the requested elements updated. The object will
retain its original class unless an element is updated which the original
class does not support. In this case, the date returned will be a POSIXlt
date object.
}
\description{
\code{update.Date()} and \code{update.POSIXt()} return a date with the specified
elements updated.  Elements not specified will be left unaltered. update.Date
and update.POSIXt do not add the specified values to the existing date, they
substitute them for the appropriate parts of the existing date.
}
\examples{
date <- ymd("2009-02-10")
update(date, year = 2010, month = 1, mday = 1)

update(date, year =2010, month = 13, mday = 1)

update(date, minute = 10, second = 3)
}
\keyword{chron}
\keyword{manip}