File: date_seq.Rd

package info (click to toggle)
r-cran-clock 0.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,856 kB
  • sloc: cpp: 19,564; sh: 17; makefile: 2
file content (52 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download | duplicates (2)
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
49
50
51
52
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/date.R
\name{date_seq}
\alias{date_seq}
\title{Sequences: date and date-time}
\usage{
date_seq(from, ..., to = NULL, by = NULL, total_size = NULL)
}
\arguments{
\item{from}{\verb{[Date(1) / POSIXct(1) / POSIXlt(1)]}

A date or date-time to start the sequence from.}

\item{...}{These dots are for future extensions and must be empty.}

\item{to}{\verb{[Date(1) / POSIXct(1) / POSIXlt(1) / NULL]}

A date or date-time to stop the sequence at.

\code{to} is only included in the result if the resulting sequence divides
the distance between \code{from} and \code{to} exactly.}

\item{by}{\verb{[integer(1) / clock_duration(1) / NULL]}

The unit to increment the sequence by.}

\item{total_size}{\verb{[positive integer(1) / NULL]}

The size of the resulting sequence.

If specified alongside \code{to}, this must generate a non-fractional sequence
between \code{from} and \code{to}.}
}
\value{
A date or date-time vector.
}
\description{
\code{date_seq()} generates a date (Date) or date-time (POSIXct/POSIXlt) sequence.

There are separate help pages for generating sequences for dates and
date-times:
\itemize{
\item \link[=date-sequence]{dates (Date)}
\item \link[=posixt-sequence]{date-times (POSIXct/POSIXlt)}
}
}
\examples{
# See method specific documentation for more examples

x <- as.Date("2019-01-01")
date_seq(x, by = duration_months(2), total_size = 20)
}