-
Notifications
You must be signed in to change notification settings - Fork 6
/
README.Rmd
62 lines (44 loc) · 1.85 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
output:
github_document:
html_preview: false
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
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 <img src="man/figures/logo.svg" align="right" height="120" width="139" />
Convenience functions for the lubridate package
<!-- badges: start -->
[![R build status](https://github.com/ellisvalentiner/lubridateExtras/workflows/R-CMD-check/badge.svg)](https://github.com/ellisvalentiner/lubridateExtras/actions)
[![Coverage]([![codecov](https://codecov.io/gh/ellisvalentiner/lubridateExtras/branch/main/graph/badge.svg?token=G4DGE1C5dG)](https://codecov.io/gh/ellisvalentiner/lubridateExtras))](https://app.codecov.io/gh/ellisvalentiner/lubridateExtras/)
<!-- badges: end -->
## 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
```{r, eval = FALSE}
# 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](https://github.com/ellisvalentiner/lubridateExtras/issues).
## Usage
```{r}
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
```