Top "Lubridate" questions

lubridate is an R package that makes it easier to work with dates and time objects.

Add/subtract 6 months (bond time) in R using lubridate

I am looking to add and subtract six months reliably with lubridate. For example, adding six months to 12/31/2014 should result …

r date lubridate
Generate a sequence of the last day of the month over two years

I use lubridate and figured that this would be so easy ymd("2010-01-31")+months(0:23) But look what one gets. …

r date lubridate
Have lubridate subtraction return only a numeric value

I have one variable called Started which is the date on which human subjects enrolled in a study and another …

r date package lubridate
Time difference in years with lubridate?

I would like to use lubridate to calculate age in years given their date of birth and today's date. Right …

r lubridate
Convert date time to a formatted time string

I don't know why it doesn't work. Here is my code: > t <- hms("14:11:49") > t [1] "14H 11M 49…

r datetime lubridate
Simplest way to extract date from timestamp

Consider the following timestamp timestamp <- ymd_hms("2011-08-10 14:00:00", tz = "Pacific/Auckland") > timestamp [1] "2011-08-10 14:00:00 NZST" What …

r datetime lubridate
Efficient and accurate age calculation (in years, months, or weeks) in R given birth date and an arbitrary date

I am facing the common task of calculating the age (in years, months, or weeks) given the date of birth …

r lubridate
dplyr, lubridate : how to aggregate a dataframe by week?

Consider the following example library(tidyverse) library(lubridate) time <- seq(from =ymd("2014-02-24"),to= ymd("2014-03-20"), …

r dplyr xts lubridate
Summing rows by month in R

So I have a data frame that has a date column, an hour column and a series of other numerical …

r dataframe dplyr aggregate lubridate
R lubridate converting seconds to date

I have a simple question regarding R's lubridate package. I've a series of timestamps in seconds since epoch. I want …

r lubridate