r-hub / cranlogs

Download Logs from the RStudio CRAN Mirror
https://r-hub.github.io/cranlogs/
Other
80 stars 13 forks source link

Missing day when specifying "when" argument #24

Closed sscogges closed 5 years ago

sscogges commented 7 years ago

When using cran_downloads() just now I get the following behavior:

cran_downloads(when = "last-day", package = "ggplot2") # date count package # 1 2017-09-02 0 ggplot2

cran_downloads(when = "last-week", package = "ggplot2") # date count package # 1 2017-08-25 10056 ggplot2 # 2 2017-08-26 5554 ggplot2 # 3 2017-08-27 4916 ggplot2 # 4 2017-08-28 12029 ggplot2 # 5 2017-08-29 13470 ggplot2 # 6 2017-08-30 14024 ggplot2 # 7 2017-08-31 14205 ggplot2

I was expecting "last-week" to include Sept 1, but it was skipped over. Is this the intended behavior or is it a bug?

maelle commented 5 years ago

related to #19 I think?

maelle commented 5 years ago

Related to #19, and now fixed, both argument values will now return data until the last day for which data is available.

cranlogs::cran_downloads(when = "last-day", package = "ggplot2")
#>         date count package
#> 1 2019-04-09 38956 ggplot2
cranlogs::cran_downloads(when = "last-week", package = "ggplot2")
#>         date count package
#> 1 2019-04-03 31342 ggplot2
#> 2 2019-04-04 31295 ggplot2
#> 3 2019-04-05 26908 ggplot2
#> 4 2019-04-06 14608 ggplot2
#> 5 2019-04-07 20784 ggplot2
#> 6 2019-04-08 40686 ggplot2
#> 7 2019-04-09 38956 ggplot2

Created on 2019-04-11 by the reprex package (v0.2.1)

Session info ``` r devtools::session_info() #> ─ Session info ────────────────────────────────────────────────────────── #> setting value #> version R version 3.5.3 (2019-03-11) #> os Ubuntu 18.04.2 LTS #> system x86_64, linux-gnu #> ui X11 #> language en_US #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz Europe/Paris #> date 2019-04-11 #> #> ─ Packages ────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.5.3) #> backports 1.1.3 2018-12-14 [1] CRAN (R 3.5.3) #> callr 3.2.0 2019-03-15 [1] CRAN (R 3.5.3) #> cli 1.1.0 2019-03-19 [1] CRAN (R 3.5.3) #> cranlogs 2.1.1.900 2019-04-11 [1] local #> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.3) #> curl 3.3 2019-01-10 [1] CRAN (R 3.5.3) #> desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.3) #> devtools 2.0.2 2019-04-08 [1] CRAN (R 3.5.3) #> digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.3) #> evaluate 0.13 2019-02-12 [1] CRAN (R 3.5.3) #> fs 1.2.7 2019-03-19 [1] CRAN (R 3.5.3) #> glue 1.3.1 2019-03-12 [1] CRAN (R 3.5.3) #> highr 0.8 2019-03-20 [1] CRAN (R 3.5.3) #> htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.3) #> httr 1.4.0 2018-12-11 [1] CRAN (R 3.5.3) #> jsonlite 1.6 2018-12-07 [1] CRAN (R 3.5.3) #> knitr 1.22 2019-03-08 [1] CRAN (R 3.5.3) #> magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.3) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.3) #> pkgbuild 1.0.3 2019-03-20 [1] CRAN (R 3.5.3) #> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.5.3) #> prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.3) #> processx 3.3.0 2019-03-10 [1] CRAN (R 3.5.3) #> ps 1.3.0 2018-12-21 [1] CRAN (R 3.5.3) #> R6 2.4.0 2019-02-14 [1] CRAN (R 3.5.3) #> Rcpp 1.0.1 2019-03-17 [1] CRAN (R 3.5.3) #> remotes 2.0.3 2019-04-09 [1] CRAN (R 3.5.3) #> rlang 0.3.4 2019-04-07 [1] CRAN (R 3.5.3) #> rmarkdown 1.12 2019-03-14 [1] CRAN (R 3.5.3) #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.3) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.3) #> stringi 1.4.3 2019-03-12 [1] CRAN (R 3.5.3) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.5.3) #> usethis 1.5.0 2019-04-07 [1] CRAN (R 3.5.3) #> withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.3) #> xfun 0.6 2019-04-02 [1] CRAN (R 3.5.3) #> yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.3) #> #> [1] /home/maelle/R/x86_64-pc-linux-gnu-library/3.5 #> [2] /usr/local/lib/R/site-library #> [3] /usr/lib/R/site-library #> [4] /usr/lib/R/library ```