-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R CMD check test failure #279
Comments
Hi @pitkant When #264 was introduced, these lines: eurostat/R/get_eurostat_geospatial.R Lines 234 to 237 in 327964a
were a little bit odd to me. This is because The error you are getting are in fact coming from sf, see: https://github.com/r-spatial/sf/blob/acaf33ed7b2ec4de965196daea7e001657c6e39a/R/sf.R#L383-L404 I would go for another approach for dropping the sf-specific attributes by:
I would try this alternative implementation, see: library(eurostat)
#> Warning: package 'eurostat' was built under R version 4.1.3
data("eurostat_geodata_60_2016")
shp <- eurostat_geodata_60_2016
# Start alternative -----
# Remove geometry without sf package
# New classes, set tibble as base for classes
new_class <- intersect(class(shp), class(tibble::tibble()))
# Identify sf column with geometry for removal
geom_col <- attr(shp, "sf_column")
# Unclass and remove specific sf columns
class(shp) <- new_class
shp <- shp[, setdiff(names(shp), geom_col)]
# End alternative ----
# Contrast
class(shp)
#> [1] "data.frame"
names(shp)
#> [1] "id" "LEVL_CODE" "NUTS_ID" "CNTR_CODE" "NAME_LATN"
#> [6] "NUTS_NAME" "MOUNT_TYPE" "URBN_TYPE" "COAST_TYPE" "FID"
#> [11] "geo"
# Check if same result as sf::st_drop_geometry()
with_sf <- sf::st_drop_geometry(shp)
identical(with_sf, shp)
#> [1] TRUE Created on 2023-10-09 with reprex v2.0.2 |
Thank you! I have to admit I was sloppy by not checking properly whether |
Actually now that I was testing this it seems that the new
While it's nice that there's a specific order for columns I can't actually recall what was the rationale for adding this function in the package. |
Hi @pitkant The function was introduced after this comment #264 (comment) and issue #240 What I have found is that |
Yes, although it is a neat function in my opinion and adds a consistent and predictable structure to geospatial objects. I would lean towards making all geospatial functions in eurostat package depend on having sf package installed. It would certainly make our job much easier. How much value does it add to read the singular 2016 file from data folder as a data.frame object? Sure it can be used to get some regional ID codes and region names, but other than that? |
Agree, I would do the changes requiring sf so we can avoid workarounds. One question, in which branch? This is also in v4-dev |
v4-dev would be perfect, yes. I will merge httr2 branch there as well soon and if all tests pass it will go to v4 (and CRAN release) and after CRAN release into master branch. |
I now get the following errors in
These are related to
This is due to HTTP status 503 from GISCO:
That made me wonder if GISCO is using a DDoS protection system as the situation is similar to the situation this Stack Overflow post is describing: https://stackoverflow.com/a/47729625/14413481 @dieghernan Do you get similar errors when running R CMD check on |
Hi @pitkant , I received today an email from CRAN related with this, also some users are reporting this rOpenGov/giscoR#69 See there |
Hi @pitkant New release of giscoR is now on CRAN, the error should be fixed now. Please allow a couple of days on the action since I think it uses posit package manager instead of CRAN, it may take some time until it updates giscoR to 0.4.0 https://packagemanager.posit.co/client/#/repos/cran/packages/giscoR/611842/overview?search=giscoR%23package-details |
DM me on technical infrastructure issues.. |
Thank you for your message @hannesaddec , I will do so in the future. @dieghernan I ran the tests with new version of giscoR, everything worked great |
Closed with the CRAN release of package version 4.0.0 |
In current httr2 branch there seems to be a test failure in test_03_get_eurostat_geospatial:
Specifically this seems to be related to this part of the code:
https://github.com/rOpenGov/eurostat/blob/327964ab096d9207b8e669fe74773d8fb11987a6/R/get_eurostat_geospatial.R#L231:L242
The
sf::st_drop_geometry(shp)
was complemented withshp$geometry <- NULL
in PR #264 . I'm not sure if the problem has existed until that moment.Something similar was reported in sf packages GitHub issues but this was supposed to be fixed back in 2019: r-spatial/sf#1057
This occurs only when building and running the check --as-cran from the terminal. In RStudio checking the package --as-cran works fine for some reason.
Any ideas why this is happening? @dieghernan
The text was updated successfully, but these errors were encountered: