knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
options(
  tibble.print_min = 5,
  tibble.print_max = 5
)
Sys.setenv(TZ = "America/Detroit")

lubridateExtras

Convenience functions for the lubridate package

R build status Coverage

Overview

Lubridate makes it easier to work with date-time data in R and provides new capabilities. LubridateExtras builds on top of lubridate to provide a number of convenience functions, primarily focused on abstracting patterns in ways that improve code readability and reduce copying and pasting code.

Installation

# lubridateExtras is not currently on CRAN
# Please install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("ellisvalentiner/lubridateExtras")

If you encounter a clear bug, please file a minimal reproducible example on github.

Usage

library(lubridateExtras)

yesterday()

tomorrow()

days_ago(7)  # equivalent to lubridate::today() - lubridate::days(7)

days_hence(7)  # equivalent to lubridate::today() + lubridate::days(7)

hms("2017-10-22 15:33:00")  # extracts the time-of-day component


ellisvalentiner/lubridateExtras documentation built on March 31, 2022, 8:52 a.m.