Skip to content
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

Vulnerability to absence of retiring r-spatial packages #147

Closed
rsbivand opened this issue Apr 3, 2023 · 9 comments
Closed

Vulnerability to absence of retiring r-spatial packages #147

rsbivand opened this issue Apr 3, 2023 · 9 comments

Comments

@rsbivand
Copy link

rsbivand commented Apr 3, 2023

00check.log
is a recent check log from running under _SP_EVOLUTION_STATUS_=2 without retiring r-spatial packages (suggested in this package) on the library path. The minimal correction is to check that the package namespaces can be loaded, and if not, do not run those parts of the examples or vignettes. It would be safer in the longer term to replace retiring r-spatial packages with active r-spatial/rspatial packages (see https://r-spatial.org/r/2022/04/12/evolution.html, https://r-spatial.org/r/2022/12/14/evolution2.html).

@clnsmth
Copy link
Contributor

clnsmth commented Apr 3, 2023

Thanks for reaching out @rsbivand. I agree, the preferred approach is to replace the retiring R spatial packages with active ones.

@sokole, do you have any cycles to put into this? I think you are most familiar with this part of the code base.

@sokole
Copy link
Collaborator

sokole commented Apr 3, 2023

@clnsmth I'll try to address this in my next pull request to dev.

@rsbivand
Copy link
Author

Please also see https://r-spatial.org/r/2023/04/10/evolution3.html, fix best by June, latest October 2023.

@sokole
Copy link
Collaborator

sokole commented Apr 26, 2023

thanks for the link @rsbivand

@pdil
Copy link

pdil commented Jun 9, 2023

@sokole Because of this change, usmap_transform from the usmap package now requires the sf package. ecocomDP will result in the following error once usmap is updated soon:

Package: ecocomDP
Check: examples
New result: ERROR
  Running examples in ‘ecocomDP-Ex.R’ failed
  The error most likely occurred in:
  
  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: plot_sites
  > ### Title: Plot sites on US map
  > ### Aliases: plot_sites
  > 
  > ### ** Examples
  > 
  > ## Not run: 
  > ##D # Read a dataset of interest
  > ##D dataset <- read_data("edi.193.5")
  > ##D 
  > ##D # Plot the dataset
  > ##D plot_sites(dataset)
  > ##D 
  > ##D # Flatten dataset then plot
  > ##D dataset %>% 
  > ##D   flatten_data() %>% 
  > ##D   plot_sites()
  > ## End(Not run)
  > 
  > # Plot the example dataset
  > plot_sites(ants_L1)
  The legacy packages maptools, rgdal, and rgeos, underpinning this package
  will retire shortly. Please refer to R-spatial evolution reports on
  https://r-spatial.org/r/2023/05/15/evolution4.html for details.
  This package is now running under evolution status 0 
  Please note that 'maptools' will be retired during October 2023,
  plan transition at your earliest convenience (see
  https://r-spatial.org/r/2023/05/15/evolution4.html and earlier blogs
  for guidance);some functionality will be moved to 'sp'.
   Checking rgeos availability: FALSE
  Please note that rgdal will be retired during October 2023,
  plan transition to sf/stars/terra functions using GDAL and PROJ
  at your earliest convenience.
  See https://r-spatial.org/r/2023/05/15/evolution4.html and https://github.com/r-spatial/evolution
  rgdal: version: 1.6-7, (SVN revision 1203)
  Geospatial Data Abstraction Library extensions to R successfully loaded
  Loaded GDAL runtime: GDAL 3.6.2, released 2023/01/02
  Path to GDAL shared files: /usr/share/gdal
   GDAL does not use iconv for recoding strings.
  GDAL binary built with GEOS: TRUE 
  Loaded PROJ runtime: Rel. 9.1.1, December 1st, 2022, [PJ_VERSION: 911]
  Path to PROJ shared files: /home/hornik/.local/share/proj:/usr/share/proj
  PROJ CDN enabled: FALSE
  Linking to sp version:1.6-1
  To mute warnings of possible GDAL/OSR exportToProj4() degradation,
  use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal.
  Error in usmap::usmap_transform(cleaned, input_names = c("longitude",  : 
    `sf` must be installed to use `usmap_transform`.
           Use: install.packages("sf") and try again.
  Calls: plot_sites
  Execution halted

The simplest fix would be to add sf to your DESCRIPTION/Suggests and/or importing it whenever usmap_transform() or usmap_crs() is used.

@rsbivand
Copy link
Author

rsbivand commented Jun 9, 2023

And https://r-spatial.org/r/2023/05/15/evolution4.html. Expect package to fail CRAN CMD check with _R_CHECK_SUGGESTS_ONLY_=true when sp 2.0-0 is published very soon, if sf is not added to Suggests:

@rsbivand
Copy link
Author

See pdil/usmap#70; new usmap release forthcoming. You need to add sf to Suggests: in DESCRIPTION, if you do so, ecocomDP passes CMD check also with _R_CHECK_SUGGESTS_ONLY_=true.

@sokole
Copy link
Collaborator

sokole commented Jun 12, 2023

@clnsmth we have a fix for this, will submit PR this week.

RafaelRangel0 added a commit to RafaelRangel0/ecocomDP that referenced this issue Jun 12, 2023
sokole added a commit to sokole/ecocomDP that referenced this issue Jun 13, 2023
clnsmth pushed a commit that referenced this issue Jun 14, 2023
* Updated plot_sites for issue #147

* Added sf to suggests

* remove size_var from plot_sites
update .Rd files

* make legend plot only when multiple values exist for at least one of the arguments

* further updates for plot_sites fix

* plot_sites fix unquoted column calls

---------

Co-authored-by: RafaelRangel0 <rafrangel0z6@gmail.com>
@rsbivand
Copy link
Author

rsbivand commented Jul 8, 2023

Thanks!

@rsbivand rsbivand closed this as completed Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants