Movatterモバイル変換


[0]ホーム

URL:


rdrr.io

seq.Date: Generate Regular Sequences of Dates

seq.DateR Documentation

Generate Regular Sequences of Dates

Description

The method forseq for objects of class"Date" representing calendar dates.

Usage

## S3 method for class 'Date'seq(from, to, by, length.out = NULL, along.with = NULL, ...)

Arguments

from

starting date. Required

to

end date. Optional.

by

increment of the sequence. Optional. See ‘Details’.

length.out

integer, optional. Desired length of the sequence.

along.with

take the length from the length of this argument.

...

arguments passed to or from other methods.

Details

by can be specified in several ways.

  • A number, taken to be in days.

  • A object of classdifftime

  • A character string, containing one of"day","week","month","quarter" or"year".This can optionally be preceded by a (positive or negative) integerand a space, or followed by"s".

    Seeseq.POSIXt for the details of"month".

Value

A vector of class"Date".

See Also

Date

Examples

## first days of yearsseq(as.Date("1910/1/1"), as.Date("1999/1/1"), "years")## by monthseq(as.Date("2000/1/1"), by = "month", length.out = 12)## quartersseq(as.Date("2000/1/1"), as.Date("2003/1/1"), by = "quarter")## find all 7th of the month between two dates, the last being a 7th.st <- as.Date("1998-12-17")en <- as.Date("2000-1-7")ll <- seq(en, st, by = "-1 month")rev(ll[ll > st & ll < en])

What can we improve?

R Package Documentation

Browse R Packages

We want your feedback!

Note that we can't provide technical support on individual packages. You should contact the package authors for that.

 
Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, readEmbedding Snippets.

Close

[8]ページ先頭

©2009-2025 Movatter.jp