Description Usage Arguments Value Author(s) Examples
Given a fractional number of years you need to convert into years, months and days to do date math
See the example for the conversion
1 | YearsMonthsDays(years)
|
years |
Fractional years: 2 years, 3 months, 10 days = 2 + 3/12 + 10/365 = 2.277397 |
a lubridate period object
George Fisher
1 2 3 4 5 | library(ustreasuries)
(diff_tm <- YearsMonthsDays(2 + 3/12 + 10/365))
# July 1, 2000 plus 2 years (2002), 3 months (10), 10 days (11)
as.Date(lubridate::ymd("2000/07/01") + diff_tm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.