From b0cb75fbc12dadd10a2aa37ae145a8008cdd2a5f Mon Sep 17 00:00:00 2001 From: Ellis Valentiner Date: Sun, 24 Sep 2017 22:13:26 -0400 Subject: [PATCH] Add more written documentation for pkgdown site --- NEWS.md | 6 ++ R/instants.R | 4 +- README.Rmd | 8 ++ README.md | 17 ++++- _pkgdown.yml | 2 +- docs/LICENSE.html | 2 +- docs/articles/index.html | 110 ++++++++++++++++++++++++++++ docs/articles/intro.html | 112 ++++++++++++++++++++++++++++ docs/authors.html | 2 +- docs/index.html | 18 ++++- docs/news/index.html | 126 ++++++++++++++++++++++++++++++++ docs/pkgdown.yml | 3 +- docs/reference/days_ago.html | 4 +- docs/reference/days_hence.html | 4 +- docs/reference/figures/logo.svg | 7 -- docs/reference/index.html | 2 +- docs/reference/is.weekday.html | 2 +- docs/reference/is.weekend.html | 2 +- docs/reference/last_month.html | 2 +- docs/reference/next_month.html | 2 +- docs/reference/this_month.html | 2 +- docs/reference/tomorrow.html | 4 +- docs/reference/yesterday.html | 4 +- man/figures/logo.svg | 7 -- vignettes/intro.Rmd | 36 +++++++++ 25 files changed, 449 insertions(+), 39 deletions(-) create mode 100644 NEWS.md create mode 100644 docs/articles/index.html create mode 100644 docs/articles/intro.html create mode 100644 docs/news/index.html create mode 100644 vignettes/intro.Rmd diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..b2c22fc --- /dev/null +++ b/NEWS.md @@ -0,0 +1,6 @@ + +# lubridateExtras 0.1.0 + +## 2017-09-24 + +* Initial release notes diff --git a/R/instants.R b/R/instants.R index d67a41f..ac0d75b 100644 --- a/R/instants.R +++ b/R/instants.R @@ -104,7 +104,7 @@ next_month <- function(tzone = "") { #' is.weekend("2017-08-29") # FALSE #' is.weekend("2017-09-02") # TRUE is.weekend <- function(x) { - wday(x = as_date(x), label = FALSE, abbr = FALSE) %in% 6:7 + wday(x = as_date(x), label = FALSE, abbr = FALSE) %in% c(1, 7) } #' Is x a weekday? @@ -118,5 +118,5 @@ is.weekend <- function(x) { #' is.weekend("2017-08-29") # FALSE #' is.weekend("2017-09-02") # TRUE is.weekday <- function(x) { - wday(x = as_date(x), label = FALSE, abbr = FALSE) %in% 1:5 + wday(x = as_date(x), label = FALSE, abbr = FALSE) %in% 2:6 } diff --git a/README.Rmd b/README.Rmd index 47ad105..91daa79 100644 --- a/README.Rmd +++ b/README.Rmd @@ -41,9 +41,17 @@ If you encounter a clear bug, please file a minimal reproducible example on [git ```{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) ``` +## Why lubridateExtras? + +Some people are probably asking the question: why lubridateExtras? +lubridateExtras does not do anything that you cannot do with lubridate but similarly you don't need lubridate at all to work with date/times in R! If you like the syntactic sugar of lubridateExtras then use it, otherwise stick with what works for you. diff --git a/README.md b/README.md index b6685fb..e4f9fc4 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,22 @@ Usage ``` r library(lubridateExtras) +yesterday() +#> [1] "2017-09-23" + +tomorrow() +#> [1] "2017-09-25" + days_ago(7) # equivalent to lubridate::today() - lubridate::days(7) -#> [1] "2017-09-14" +#> [1] "2017-09-17" days_hence(7) # equivalent to lubridate::today() + lubridate::days(7) -#> [1] "2017-09-28" +#> [1] "2017-10-01" ``` + +Why lubridateExtras? +-------------------- + +Some people are probably asking the question: why lubridateExtras? + +lubridateExtras does not do anything that you cannot do with lubridate but similarly you don't need lubridate at all to work with date/times in R! If you like the syntactic sugar of lubridateExtras then use it, otherwise stick with what works for you. diff --git a/_pkgdown.yml b/_pkgdown.yml index 78fc6b5..87f04d4 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -11,7 +11,7 @@ navbar: type: default left: - text: Intro - href: lubridateExtras.html + href: articles/intro.html - text: Reference href: reference/index.html - text: News diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 5b7bc16..cd44d67 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -52,7 +52,7 @@ diff --git a/docs/news/index.html b/docs/news/index.html new file mode 100644 index 0000000..1007797 --- /dev/null +++ b/docs/news/index.html @@ -0,0 +1,126 @@ + + + + + + + + +All news • lubridateExtras + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ +
+ + +
+
+

+lubridateExtras 0.1.0

+
+

+2017-09-24

+
    +
  • Initial release notes
  • +
+
+
+
+
+ + + +
+ +
+ + +
+

Site built with pkgdown.

+
+ +
+
+ + + diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 82187a8..3fe767b 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,5 +1,6 @@ urls: reference: https://ellisvalentiner.github.com/lubridateExtras/reference article: https://ellisvalentiner.github.com/lubridateExtras/articles -articles: {} +articles: + intro: intro.html diff --git a/docs/reference/days_ago.html b/docs/reference/days_ago.html index 365fd68..d3fce2a 100644 --- a/docs/reference/days_ago.html +++ b/docs/reference/days_ago.html @@ -52,7 +52,7 @@