Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_dates

Retrieve dates from an incidence object


Description

Retrieve dates from an incidence object

Usage

get_dates(x, ...)

## Default S3 method:
get_dates(x, ...)

## S3 method for class 'incidence'
get_dates(x, position = "left", count_days = FALSE, ...)

Arguments

x

an incidence object

...

Unused

position

One of "left", "center", "middle", or "right" specifying what side of the bin the date should be drawn from.

count_days

If TRUE, the result will be represented as the number of days from the first date.

Value

a vector of dates or numerics

Examples

set.seed(999)
dat <- as.Date(Sys.Date()) + sample(-3:50, 100, replace = TRUE)
x <- incidence(dat, interval = "month")
get_dates(x)
get_dates(x, position = "middle")
set.seed(999)
dat <- as.Date(Sys.Date()) + sample(-3:50, 100, replace = TRUE)
x <- incidence(dat, interval = "month")
get_dates(x)
get_dates(x, "center")
get_dates(x, "right")

# Return dates by number of days from the first date
get_dates(x, count_days = TRUE)
get_dates(incidence(-5:5), count_days = TRUE)

incidence

Compute, Handle, Plot and Model Incidence of Dated Events

v1.7.3
MIT + file LICENSE
Authors
Thibaut Jombart [aut], Zhian N. Kamvar [aut] (<https://orcid.org/0000-0003-1458-7108>), Rich FitzJohn [aut], Tim Taylor [cre] (<https://orcid.org/0000-0002-8587-7113>), Jun Cai [ctb] (<https://orcid.org/0000-0001-9495-1226>), Sangeeta Bhatia [ctb], Jakob Schumacher [ctb], Juliet R.C. Pulliam [ctb] (<https://orcid.org/0000-0003-3314-8223>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.