ropensci/stats19

Can't make stats19 work: "Error in isFALSE(silent)"

ccamara opened this issue · 7 comments

I have just discovered this package which looks really promising. Unfortunately, I haven't been able to run even the most basic commands:

crashes = get_stats19(year = 2017, type = "accident", ask = FALSE)

Results in: "Error in isFALSE(silent)" and cannot resume.

The same happens with dl_stats19(year = 2017) after selecting the type of data I want to download.

I am currently using R 3.4.4 with ubuntu 18.04. Didn't see any problem installing the package.

Am I missing something?

layik commented

I can only suggest a shared env to test this out. I didn't get an error last night when I ran a markdown doc.

Could you give us a reprex? Session info?

I cannot reproduce the issue on the CRAN version:

library(stats19)
#> Data provided under OGL v3.0. Cite the source and link to:
#> www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
    crashes = get_stats19(year = 2017, type = "accident", ask = FALSE)
#> Files identified: dftRoadSafetyData_Accidents_2017.zip
#>    http://data.dft.gov.uk.s3.amazonaws.com/road-accidents-safety-data/dftRoadSafetyData_Accidents_2017.zip
#> Data already exists in data_dir, not downloading
#> Data saved at ~/stats19-data/dftRoadSafetyData_Accidents_2017/Acc.csv
#> Reading in:
#> /home/robin/stats19-data/dftRoadSafetyData_Accidents_2017/Acc.csv
#> date and time columns present, creating formatted datetime column
    crashes
#> # A tibble: 129,982 x 33
#>    accident_index location_eastin… location_northi… longitude latitude
#>    <chr>                     <int>            <int>     <dbl>    <dbl>
#>  1 2017010001708            532920           196330   -0.0801     51.7
#>  2 2017010009342            526790           181970   -0.174      51.5
#>  3 2017010009344            535200           181260   -0.0530     51.5
#>  4 2017010009348            534340           193560   -0.0607     51.6
#>  5 2017010009350            533680           187820   -0.0724     51.6
#>  6 2017010009351            514510           172370   -0.354      51.4
#>  7 2017010009353            508640           181870   -0.435      51.5
#>  8 2017010009354            527880           181950   -0.158      51.5
#>  9 2017010009357            520940           192820   -0.254      51.6
#> 10 2017010009358            531430           178450   -0.108      51.5
#> # … with 129,972 more rows, and 28 more variables: police_force <chr>,
#> #   accident_severity <chr>, number_of_vehicles <int>,
#> #   number_of_casualties <int>, date <date>, day_of_week <chr>, time <chr>,
#> #   local_authority_district <chr>, local_authority_highway <chr>,
#> #   first_road_class <chr>, first_road_number <int>, road_type <chr>,
#> #   speed_limit <int>, junction_detail <chr>, junction_control <chr>,
#> #   second_road_class <chr>, second_road_number <int>,
#> #   pedestrian_crossing_human_control <chr>,
#> #   pedestrian_crossing_physical_facilities <chr>, light_conditions <chr>,
#> #   weather_conditions <chr>, road_surface_conditions <chr>,
#> #   special_conditions_at_site <chr>, carriageway_hazards <chr>,
#> #   urban_or_rural_area <chr>,
#> #   did_police_officer_attend_scene_of_accident <int>,
#> #   lsoa_of_accident_location <chr>, datetime <dttm>

Created on 2020-06-01 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.6.3 (2020-02-29)
#>  os       Ubuntu 18.04.4 LTS          
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language en_GB:en                    
#>  collate  en_GB.UTF-8                 
#>  ctype    en_GB.UTF-8                 
#>  tz       Europe/London               
#>  date     2020-06-01                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version    date       lib source                            
#>  assertthat    0.2.1      2019-03-21 [2] CRAN (R 3.6.0)                    
#>  backports     1.1.7      2020-05-13 [1] CRAN (R 3.6.3)                    
#>  callr         3.4.3      2020-03-28 [1] CRAN (R 3.6.3)                    
#>  cli           2.0.2      2020-02-28 [1] CRAN (R 3.6.2)                    
#>  crayon        1.3.4      2017-09-16 [2] standard (@1.3.4)                 
#>  desc          1.2.0      2018-05-01 [2] standard (@1.2.0)                 
#>  devtools      2.3.0      2020-04-10 [1] CRAN (R 3.6.3)                    
#>  digest        0.6.25     2020-02-23 [1] CRAN (R 3.6.2)                    
#>  ellipsis      0.3.1      2020-05-15 [3] CRAN (R 3.6.3)                    
#>  evaluate      0.14       2019-05-28 [2] CRAN (R 3.6.0)                    
#>  fansi         0.4.1      2020-01-08 [1] CRAN (R 3.6.2)                    
#>  fs            1.4.1      2020-04-04 [2] CRAN (R 3.6.3)                    
#>  glue          1.4.1      2020-05-13 [2] CRAN (R 3.6.3)                    
#>  highr         0.8        2019-03-20 [3] CRAN (R 3.5.3)                    
#>  hms           0.5.3      2020-01-08 [1] CRAN (R 3.6.2)                    
#>  htmltools     0.4.0.9003 2020-04-09 [1] Github (rstudio/htmltools@1a7d0dc)
#>  knitr         1.28       2020-02-06 [1] CRAN (R 3.6.2)                    
#>  lifecycle     0.2.0.9000 2020-03-16 [1] Github (r-lib/lifecycle@355dcba)  
#>  magrittr      1.5        2014-11-22 [2] CRAN (R 3.5.2)                    
#>  memoise       1.1.0      2017-04-21 [3] CRAN (R 3.5.0)                    
#>  pillar        1.4.4      2020-05-05 [1] CRAN (R 3.6.3)                    
#>  pkgbuild      1.0.8      2020-05-07 [1] CRAN (R 3.6.3)                    
#>  pkgconfig     2.0.3      2019-09-22 [2] CRAN (R 3.6.1)                    
#>  pkgload       1.1.0      2020-05-29 [3] CRAN (R 3.6.3)                    
#>  prettyunits   1.1.1      2020-01-24 [1] CRAN (R 3.6.2)                    
#>  processx      3.4.2      2020-02-09 [1] CRAN (R 3.6.3)                    
#>  ps            1.3.3      2020-05-08 [1] CRAN (R 3.6.3)                    
#>  R6            2.4.1      2019-11-12 [2] CRAN (R 3.6.1)                    
#>  Rcpp          1.0.4.6    2020-04-09 [1] CRAN (R 3.6.3)                    
#>  readr         1.3.1      2018-12-21 [2] CRAN (R 3.5.3)                    
#>  remotes       2.1.1      2020-02-15 [1] CRAN (R 3.6.2)                    
#>  rlang         0.4.6.9000 2020-05-05 [1] Github (r-lib/rlang@4bea875)      
#>  rmarkdown     2.1.2      2020-04-09 [1] Github (rstudio/rmarkdown@65dd144)
#>  rprojroot     1.3-2      2018-01-03 [2] CRAN (R 3.5.3)                    
#>  sessioninfo   1.1.1      2018-11-05 [3] CRAN (R 3.5.1)                    
#>  stats19     * 1.2.0      2020-03-03 [1] CRAN (R 3.6.2)                    
#>  stringi       1.4.6      2020-02-17 [1] CRAN (R 3.6.2)                    
#>  stringr       1.4.0      2019-02-10 [2] standard (@1.4.0)                 
#>  testthat      2.3.2      2020-03-02 [1] CRAN (R 3.6.3)                    
#>  tibble        3.0.1      2020-04-20 [1] CRAN (R 3.6.3)                    
#>  usethis       1.6.1      2020-04-29 [1] CRAN (R 3.6.3)                    
#>  utf8          1.1.4      2018-05-24 [2] CRAN (R 3.5.3)                    
#>  vctrs         0.3.0      2020-05-11 [1] CRAN (R 3.6.3)                    
#>  withr         2.2.0      2020-04-20 [2] CRAN (R 3.6.3)                    
#>  xfun          0.14       2020-05-20 [1] CRAN (R 3.6.3)                    
#>  yaml          2.2.1      2020-02-01 [1] CRAN (R 3.6.2)                    
#> 
#> [1] /home/robin/R/x86_64-pc-linux-gnu-library/3.6
#> [2] /usr/local/lib/R/site-library
#> [3] /usr/lib/R/site-library
#> [4] /usr/lib/R/library

Also seems to work fine on the dev version:

remotes::install_github("ropensci/stats19")
#> Using github PAT from envvar GITHUB_PAT
#> Skipping install of 'stats19' from a github remote, the SHA1 (3faf49db) has not changed since last install.
#>   Use `force = TRUE` to force installation
library(stats19)
#> Data provided under OGL v3.0. Cite the source and link to:
#> www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
crashes = get_stats19(year = 2017, type = "accident", ask = FALSE)
#> Files identified: dftRoadSafetyData_Accidents_2017.zip
#>    http://data.dft.gov.uk.s3.amazonaws.com/road-accidents-safety-data/dftRoadSafetyData_Accidents_2017.zip
#> Data already exists in data_dir, not downloading
#> Data saved at ~/stats19-data/dftRoadSafetyData_Accidents_2017/Acc.csv
#> Reading in:
#> /home/robin/stats19-data/dftRoadSafetyData_Accidents_2017/Acc.csv
#> date and time columns present, creating formatted datetime column
crashes
#> # A tibble: 129,982 x 33
#>    accident_index location_eastin… location_northi… longitude latitude
#>    <chr>                     <int>            <int>     <dbl>    <dbl>
#>  1 2017010001708            532920           196330   -0.0801     51.7
#>  2 2017010009342            526790           181970   -0.174      51.5
#>  3 2017010009344            535200           181260   -0.0530     51.5
#>  4 2017010009348            534340           193560   -0.0607     51.6
#>  5 2017010009350            533680           187820   -0.0724     51.6
#>  6 2017010009351            514510           172370   -0.354      51.4
#>  7 2017010009353            508640           181870   -0.435      51.5
#>  8 2017010009354            527880           181950   -0.158      51.5
#>  9 2017010009357            520940           192820   -0.254      51.6
#> 10 2017010009358            531430           178450   -0.108      51.5
#> # … with 129,972 more rows, and 28 more variables: police_force <chr>,
#> #   accident_severity <chr>, number_of_vehicles <int>,
#> #   number_of_casualties <int>, date <date>, day_of_week <chr>, time <chr>,
#> #   local_authority_district <chr>, local_authority_highway <chr>,
#> #   first_road_class <chr>, first_road_number <int>, road_type <chr>,
#> #   speed_limit <int>, junction_detail <chr>, junction_control <chr>,
#> #   second_road_class <chr>, second_road_number <int>,
#> #   pedestrian_crossing_human_control <chr>,
#> #   pedestrian_crossing_physical_facilities <chr>, light_conditions <chr>,
#> #   weather_conditions <chr>, road_surface_conditions <chr>,
#> #   special_conditions_at_site <chr>, carriageway_hazards <chr>,
#> #   urban_or_rural_area <chr>,
#> #   did_police_officer_attend_scene_of_accident <int>,
#> #   lsoa_of_accident_location <chr>, datetime <dttm>

Created on 2020-06-01 by the reprex package (v0.3.0)

Thanks for the quick reply.

See session info below:

> devtools::session_info()
─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.4.4 (2018-03-15)
 os       Ubuntu 18.04.4 LTS          
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language ca:es:en_GB:en_US           
 collate  ca_ES.UTF-8                 
 ctype    ca_ES.UTF-8                 
 tz       Europe/London               
 date     2020-06-01Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version date       lib source        
 assertthat    0.2.1   2019-03-21 [1] CRAN (R 3.4.4)
 backports     1.1.4   2019-04-10 [1] CRAN (R 3.4.4)
 broom         0.5.2   2019-04-07 [1] CRAN (R 3.4.4)
 callr         3.3.1   2019-07-18 [1] CRAN (R 3.4.4)
 cellranger    1.1.0   2016-07-27 [1] CRAN (R 3.4.4)
 cli           2.0.2   2020-02-28 [1] CRAN (R 3.4.4)
 colorspace    1.4-1   2019-03-18 [1] CRAN (R 3.4.4)
 crayon        1.3.4   2017-09-16 [1] CRAN (R 3.4.4)
 DBI           1.1.0   2019-12-15 [1] CRAN (R 3.4.4)
 dbplyr        1.4.2   2019-06-17 [1] CRAN (R 3.4.4)
 desc          1.2.0   2018-05-01 [1] CRAN (R 3.4.4)
 devtools      2.1.0   2019-07-06 [1] CRAN (R 3.4.4)
 digest        0.6.25  2020-02-23 [1] CRAN (R 3.4.4)
 dplyr       * 0.8.5   2020-03-07 [1] CRAN (R 3.4.4)
 ellipsis      0.3.1   2020-05-15 [1] CRAN (R 3.4.4)
 fansi         0.4.1   2020-01-08 [1] CRAN (R 3.4.4)
 forcats     * 0.5.0   2020-03-01 [1] CRAN (R 3.4.4)
 fs            1.3.1   2019-05-06 [1] CRAN (R 3.4.4)
 generics      0.0.2   2018-11-29 [1] CRAN (R 3.4.4)
 ggplot2     * 3.2.1   2019-08-10 [1] CRAN (R 3.4.4)
 glue          1.4.1   2020-05-13 [1] CRAN (R 3.4.4)
 gtable        0.3.0   2019-03-25 [1] CRAN (R 3.4.4)
 haven         2.2.0   2019-11-08 [1] CRAN (R 3.4.4)
 here        * 0.1     2017-05-28 [1] CRAN (R 3.4.4)
 hms           0.5.3   2020-01-08 [1] CRAN (R 3.4.4)
 httr          1.4.1   2019-08-05 [1] CRAN (R 3.4.4)
 jsonlite      1.6.1   2020-02-02 [1] CRAN (R 3.4.4)
 lattice       0.20-35 2017-03-25 [4] CRAN (R 3.4.2)
 lazyeval      0.2.2   2019-03-15 [1] CRAN (R 3.4.4)
 lifecycle     0.2.0   2020-03-06 [1] CRAN (R 3.4.4)
 lubridate     1.7.4   2018-04-11 [1] CRAN (R 3.4.4)
 magrittr      1.5     2014-11-22 [1] CRAN (R 3.4.4)
 memoise       1.1.0   2017-04-21 [1] CRAN (R 3.4.4)
 modelr        0.1.5   2019-08-08 [1] CRAN (R 3.4.4)
 munsell       0.5.0   2018-06-12 [1] CRAN (R 3.4.4)
 nlme          3.1-131 2017-02-06 [4] CRAN (R 3.4.2)
 pillar        1.4.4   2020-05-05 [1] CRAN (R 3.4.4)
 pkgbuild      1.0.5   2019-08-26 [1] CRAN (R 3.4.4)
 pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 3.4.4)
 pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.4.4)
 prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.4.4)
 processx      3.4.1   2019-07-18 [1] CRAN (R 3.4.4)
 ps            1.3.0   2018-12-21 [1] CRAN (R 3.4.4)
 purrr       * 0.3.4   2020-04-17 [1] CRAN (R 3.4.4)
 R6            2.4.1   2019-11-12 [1] CRAN (R 3.4.4)
 Rcpp          1.0.4.6 2020-04-09 [1] CRAN (R 3.4.4)
 readr       * 1.3.1   2018-12-21 [1] CRAN (R 3.4.4)
 readxl        1.3.1   2019-03-13 [1] CRAN (R 3.4.4)
 remotes       2.1.1   2020-02-15 [1] CRAN (R 3.4.4)
 reprex        0.3.0   2019-05-16 [1] CRAN (R 3.4.4)
 rlang         0.4.6   2020-05-02 [1] CRAN (R 3.4.4)
 rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.4.4)
 rstudioapi    0.10    2019-03-19 [1] CRAN (R 3.4.4)
 rvest         0.3.5   2019-11-08 [1] CRAN (R 3.4.4)
 scales        1.1.0   2019-11-18 [1] CRAN (R 3.4.4)
 sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.4.4)
 stats19     * 1.2.0   2020-03-03 [1] CRAN (R 3.4.4)
 stringi       1.4.6   2020-02-17 [1] CRAN (R 3.4.4)
 stringr     * 1.4.0   2019-02-10 [1] CRAN (R 3.4.4)
 testthat      2.2.1   2019-07-25 [1] CRAN (R 3.4.4)
 tibble      * 3.0.1   2020-04-20 [1] CRAN (R 3.4.4)
 tidyr       * 1.0.0   2019-09-11 [1] CRAN (R 3.4.4)
 tidyselect    1.0.0   2020-01-27 [1] CRAN (R 3.4.4)
 tidyverse   * 1.3.0   2019-11-21 [1] CRAN (R 3.4.4)
 usethis       1.5.1   2019-07-04 [1] CRAN (R 3.4.4)
 vctrs         0.3.0   2020-05-11 [1] CRAN (R 3.4.4)
 withr         2.1.2   2018-03-15 [1] CRAN (R 3.4.4)
 xml2          1.3.2   2020-04-23 [1] CRAN (R 3.4.4)

[1] /home/ccamara/R/x86_64-pc-linux-gnu-library/3.4
[2] /usr/local/lib/R/site-library
[3] /usr/lib/R/site-library
[4] /usr/lib/R/library
> 

And here's what I get:

library("stats19")
#> Data provided under OGL v3.0. Cite the source and link to:
#> www.nationalarchives.gov.uk/doc/open-government-licence/version/3/

crashes = get_stats19(year = 2017, type = "accident", ask = FALSE)
#> Error in isFALSE(silent): no se pudo encontrar la función "isFALSE"

Created on 2020-06-01 by the reprex package (v0.3.0)

#> Error in isFALSE(silent): no se pudo encontrar la función "isFALSE"

Tienes que instalar la nueva versi'on de R: https://cran.r-project.org/bin/windows/base/old/3.5.0/NEWS.R-3.5.0.html

New function isFALSE() defined analogously to isTRUE(). 

Thank you @Robinlovelace for pointing this out and for the change in 32572ef I can confirm it is working now.

No problem, any other issues you have please let us know!