Skip to content

read_access not working with default values #61

@viniciusoike

Description

@viniciusoike

Main function read_access isn't working with default values; also, there seems to be an issue with the error message which fails to show the available years under some conditions. Also, if I'm not mistaken the problem with using aopdata::read_access() is that I'm not selecting a city (or 'all') yet the error message suggests the problem is with year.

library(aopdata)
#> Warning: package 'aopdata' was built under R version 4.5.2
aopdata::read_access()
#> Error in `select_metadata()`:
#> ! Data currently available only for the years .

aopdata::read_access(mode = "car", year = 2019)
#> Error in `select_metadata()`:
#> ! Data currently available only for the years .

# Using valid city and mode but invalid year shows the correct error message
aopdata::read_access(city = "cur", mode = "car", year = 1990)
#> Error in `select_metadata()`:
#> ! Data currently available only for the years 2017 2018 2019.

sessionInfo()
#> R version 4.5.1 (2025-06-13)
#> Platform: aarch64-apple-darwin20
#> Running under: macOS Tahoe 26.2
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRblas.0.dylib 
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
#> 
#> locale:
#> [1] C.UTF-8/C.UTF-8/C.UTF-8/C/C.UTF-8/C.UTF-8
#> 
#> time zone: America/Sao_Paulo
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] aopdata_1.1.2
#> 
#> loaded via a namespace (and not attached):
#>  [1] backports_1.5.0   digest_0.6.39     fastmap_1.2.0     xfun_0.56        
#>  [5] glue_1.8.0        knitr_1.51        htmltools_0.5.9   rmarkdown_2.30   
#>  [9] lifecycle_1.0.5   cli_3.6.5         vctrs_0.7.1       reprex_2.1.1     
#> [13] data.table_1.18.0 withr_3.0.2       compiler_4.5.1    tools_4.5.1      
#> [17] curl_7.0.0        checkmate_2.3.3   pillar_1.11.1     evaluate_1.0.5   
#> [21] yaml_2.3.12       otel_0.2.0        rlang_1.1.7       fs_1.6.6

Created on 2026-02-03 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions