* using log directory 'd:/Rcompile/CRANpkg/local/4.3/sgapi.Rcheck' * using R version 4.3.3 (2024-02-29 ucrt) * using platform: x86_64-w64-mingw32 (64-bit) * R was compiled by gcc.exe (GCC) 12.3.0 GNU Fortran (GCC) 12.3.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'sgapi/DESCRIPTION' ... OK * this is package 'sgapi' version '1.0.2' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'sgapi' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... [2s] OK * checking whether the package can be loaded with stated dependencies ... [1s] OK * checking whether the package can be unloaded cleanly ... [1s] OK * checking whether the namespace can be loaded with stated dependencies ... [1s] OK * checking whether the namespace can be unloaded cleanly ... [1s] OK * checking loading without being on the library search path ... [2s] OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [5s] OK * checking Rd files ... [1s] OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of 'data' directory ... OK * checking data for non-ASCII characters ... [1s] OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking examples ... [2s] ERROR Running examples in 'sgapi-Ex.R' failed The error most likely occurred in: > ### Name: get_available_scales > ### Title: Available Boundary Scales for 'nomis' Table > ### Aliases: get_available_scales > > ### ** Examples > > get_available_scales(id="NM_1003_1") Error in x$overview : $ operator is invalid for atomic vectors Calls: get_available_scales Execution halted * checking for unstated dependencies in 'tests' ... OK * checking tests ... [10s] ERROR Running 'testthat.R' [10s] Running the tests in 'tests/testthat.R' failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/tests.html > # * https://testthat.r-lib.org/reference/test_package.html#special-files > > library(testthat) > library(sgapi) > > test_check("sgapi") Reading layer `OGRGeoJSON' from data source `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/MSOA_Dec_2011_Boundaries_Generalised_Clipped_BGC_EW_V3_2022/FeatureServer/0/query?where=1%3D1&outFields=*&geometry=-1.282825%2C52.354169%2C0.206626%2C52.7106&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&outSR=4326&geometryPrecision=3&resultOffset=0&f=geojson' using driver `GeoJSON' Simple feature collection with 191 features and 11 fields Geometry type: MULTIPOLYGON Dimension: XY Bounding box: xmin: -1.46 ymin: 52.231 xmax: 0.368 ymax: 52.887 Geodetic CRS: WGS 84 Reading layer `OGRGeoJSON' from data source `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/MSOA_Dec_2011_Boundaries_Generalised_Clipped_BGC_EW_V3_2022/FeatureServer/0/query?where=1%3D1&outFields=*&geometry=-1.282825%2C52.354169%2C0.206626%2C52.7106&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&outSR=4326&geometryPrecision=3&resultOffset=200&f=geojson' using driver `GeoJSON' Simple feature collection with 0 features and 0 fields Bounding box: xmin: NA ymin: NA xmax: NA ymax: NA Geodetic CRS: WGS 84 Reading layer `OGRGeoJSON' from data source `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/Local_Authority_Districts_December_2022_UK_BGC_V2/FeatureServer/0/query?where=%20(LAD22NM%20%3D%20'Derbyshire%20Dales'%20OR%20LAD22NM%20%3D%20'Harrogate'%20OR%20LAD22NM%20%3D%20'West%20Northamptonshire')%20&outFields=*&outSR=4326&f=geojson' using driver `GeoJSON' Simple feature collection with 3 features and 10 fields Geometry type: POLYGON Dimension: XY Bounding box: xmin: -2.004508 ymin: 51.97729 xmax: -0.7050439 ymax: 54.26161 Geodetic CRS: WGS 84 Reading layer `OGRGeoJSON' from data source `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/MSOA_Dec_2011_Boundaries_Generalised_Clipped_BGC_EW_V3_2022/FeatureServer/0/query?where=1%3D1&outFields=*&geometry=52.354169%2C-1.282825%2C52.7106%2C0.206626&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&outSR=4326&geometryPrecision=3&resultOffset=0&f=geojson' using driver `GeoJSON' Simple feature collection with 0 features and 0 fields Bounding box: xmin: NA ymin: NA xmax: NA ymax: NA Geodetic CRS: WGS 84 Reading layer `GeoJSONSeq' from data source `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/Local_Authority_Districts_December_2022_UK_BGC_V2/FeatureServer/0/query?where=%20(L22NM%20%3D%20'Derbyshire%20Dales'%20OR%20L22NM%20%3D%20'Harrogate')%20&outFields=*&outSR=4326&f=geojson' using driver `GeoJSONSeq' Re-reading with feature count reset from 1 to 0 Simple feature collection with 0 features and 0 fields Bounding box: xmin: NA ymin: NA xmax: NA ymax: NA Geodetic CRS: WGS 84 Chosen Nomis table id or dimension does not exist, see column 'id' in sgapi::nomisTables for available table ids [ FAIL 14 | WARN 0 | SKIP 0 | PASS 42 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-get_available_scales.R:4:13'): A valid table ID should return a list ── Error in `x$overview`: $ operator is invalid for atomic vectors Backtrace: ▆ 1. ├─testthat::expect_type(get_available_scales("NM_1_1"), "list") at test-get_available_scales.R:4:13 2. │ └─testthat::quasi_label(enquo(object), arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─sgapi::get_available_scales("NM_1_1") ── Failure ('test-get_overview.R:2:5'): Error is returned for invalid table id ── `get_overview("N_1002_1")` did not throw the expected message. ── Failure ('test-get_overview.R:16:5'): Error is returned for invalid table id ── `get_table_info_brief("02_1")` did not throw the expected message. ── Failure ('test-get_structure.R:7:3'): No error is returned for valid table id ── Expected `get_structure("NM_187_1", "industry")` to run without any messages. i Actually got a with text: Chosen Nomis table id or dimension does not exist, see column 'id' in sgapi::nomisTables for available table ids ── Failure ('test-get_structure.R:12:3'): A valid table and dimension returns a list ── get_structure("NM_187_1", "industry") has type 'NULL', not 'list'. ── Failure ('test-get_structure.R:24:3'): No error is returned for valid table id ── Expected `get_structure("NM_4_1", "age_dur")` to run without any messages. i Actually got a with text: Chosen Nomis table id or dimension does not exist, see column 'id' in sgapi::nomisTables for available table ids ── Failure ('test-get_table.R:2:2'): Valid table ID returns a vector ─────────── Expected `get_table("NM_1_1", options = list(geography = "TYPE480", time = "latest"))` to run without any errors. i Actually got a with text: API has failed, review the filters applied. The status code is: 406 ── Error ('test-get_table.R:8:3'): Valid query returning over 25,000 rows sends a warning ── Error in `assert_function(raw_data$status_code >= 400L, paste0("API has failed, review the filters applied. The status code is: ", raw_data$status_code))`: API has failed, review the filters applied. The status code is: 406 Backtrace: ▆ 1. ├─testthat::expect_warning(get_table("NM_105_1", options = paste0(time = "latest"))) at test-get_table.R:8:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. └─sgapi::get_table("NM_105_1", options = paste0(time = "latest")) 8. └─sgapi::assert_function(...) ── Failure ('test-get_table.R:13:3'): Valid table ID returns a vector ────────── Expected `get_table(...)` to run without any errors. i Actually got a with text: API has failed, review the filters applied. The status code is: 406 ── Failure ('test-get_table.R:18:3'): Valid table ID returns a vector ────────── Expected `get_table(...)` to run without any errors. i Actually got a with text: API has failed, review the filters applied. The status code is: 406 ── Error ('test-get_table.R:23:3'): Valid table ID returns a list ────────────── Error in `assert_function(raw_data$status_code >= 400L, paste0("API has failed, review the filters applied. The status code is: ", raw_data$status_code))`: API has failed, review the filters applied. The status code is: 406 Backtrace: ▆ 1. ├─testthat::expect_type(...) at test-get_table.R:23:3 2. │ └─testthat::quasi_label(enquo(object), arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─sgapi::get_table(...) 5. └─sgapi::assert_function(...) ── Error ('test-get_table_dimensions.R:14:3'): Valid table ID returns a list ─── Error in `get_overview(id)$overview`: $ operator is invalid for atomic vectors Backtrace: ▆ 1. ├─testthat::expect_type(get_table_dimensions("NM_102_1"), "list") at test-get_table_dimensions.R:14:3 2. │ └─testthat::quasi_label(enquo(object), arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─sgapi::get_table_dimensions("NM_102_1") ── Error ('test-get_table_dimensions.R:20:3'): Valid table ID returns a list ─── Error in `get_overview(id)$overview`: $ operator is invalid for atomic vectors Backtrace: ▆ 1. ├─testthat::expect_type(get_table_dimensions("NM_1042_1"), "list") at test-get_table_dimensions.R:20:3 2. │ └─testthat::quasi_label(enquo(object), arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─sgapi::get_table_dimensions("NM_1042_1") ── Error ('test-list_data_sources.R:2:3'): returns a list ────────────────────── Error in `y$contenttype`: $ operator is invalid for atomic vectors Backtrace: ▆ 1. ├─testthat::expect_type(list_data_sources(), "list") at test-list_data_sources.R:2:3 2. │ └─testthat::quasi_label(enquo(object), arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─sgapi::list_data_sources() [ FAIL 14 | WARN 0 | SKIP 0 | PASS 42 ] Error: Test failures Execution halted * checking PDF version of manual ... [19s] OK * checking HTML version of manual ... [3s] OK * DONE Status: 2 ERRORs