R-ArcGIS/arcgislayers

`arc_select()` errors when `page_size = NULL`

Closed this issue · 0 comments

Describe the bug

When using arc_select() without a specified value for page_size results in an error when page_size is passed to as.integer().

To Reproduce

library(arcgislayers)
furl <- "https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Counties_Generalized_Boundaries/FeatureServer/0"
flayer <- arc_open(furl)
arc_select(flayer)
#> Error in `arc_select()`:
#> ! `as.integer(page_size)` must be a whole number or `NULL`, not an empty integer vector.
sessionInfo()
#> R version 4.4.0 (2024-04-24)
#> Platform: aarch64-apple-darwin20
#> Running under: macOS Sonoma 14.5
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> time zone: America/New_York
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] arcgislayers_0.3.0.9000
#> 
#> loaded via a namespace (and not attached):
#>  [1] vctrs_0.6.5         cli_3.6.3.9000      knitr_1.46         
#>  [4] rlang_1.1.4         xfun_0.44           purrr_1.0.2        
#>  [7] styler_1.10.3       glue_1.7.0          htmltools_0.5.8.1  
#> [10] RcppSimdJson_0.1.11 arcgisutils_0.3.0   fansi_1.0.6        
#> [13] rmarkdown_2.27      rappdirs_0.3.3      R.cache_0.16.0     
#> [16] evaluate_0.23       fastmap_1.2.0       yaml_2.3.8         
#> [19] lifecycle_1.0.4     httr2_1.0.1         compiler_4.4.0     
#> [22] fs_1.6.4            Rcpp_1.0.12         rstudioapi_0.16.0  
#> [25] R.oo_1.26.0         R.utils_2.12.3      digest_0.6.35      
#> [28] R6_2.5.1            utf8_1.2.4          reprex_2.1.0       
#> [31] pillar_1.9.0        curl_5.2.1          magrittr_2.0.3     
#> [34] R.methodsS3_1.8.2   tools_4.4.0         withr_3.0.0

Created on 2024-07-22 with reprex v2.1.0

Expected behavior

arc_select() should not error when using the default values.