1

I've got a collection of functions I use that I combine in a local R-package. This works since years. Some of the functions did rely on the packages rgdal, sp, and maptools that are close to their end of life. I managed to edit the function that they use the packages sf and terra instead. However, if I try to build the package using R-Studio and RTools43 I get the error:

> Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),
> versionCheck = vI[[j]]) : 
>      there is no package called 'maptools'

I searched all files in the directory but cannot find any file that relies on maptools. Unfortunately, the only solutions I find suggest to install the missing package, which I don`t want to do, because of the coming EOL status.

In the description file I import the following packages:

IMPORTS:
  xts,
  magrittr,
  R.utils,
  parallel,
  pbapply,
  terra,
  tools,
  data.table,
  hydroGOF,
  sf,
  plyr,
  raster,
  dygraphs,
  htmltools

I know that this is no reproducible example, but I'm not able to give one.

Thanks for any ideas.

smoff
  • 592
  • 5
  • 21
  • what command exactly is producing the error? is `traceback()` available? can you try building from the command line (in case there's some caching issue inside RStudio)? – MichaelChirico Jun 23 '23 at 08:23
  • Using the command line, I'm able to build the package, but not to install it. I get the same error, stating that `maptools` is missing. `traceback()` seems not to be available, however I have to say that I have no experience using `traceback()` – smoff Jun 23 '23 at 08:45
  • I found that the package `hydroGOF` which my package depends on, depends on `hydroTSM` which depends on `maptools`. So there is no solution at the moment. – smoff Jun 23 '23 at 09:22
  • it looks like you've already taken the next logical step, which is to report the issue to the hydroTSM maintainers: https://github.com/hzambran/hydroTSM/issues/21 (hydroGOF is maintained by the same user) – MichaelChirico Jun 24 '23 at 18:03
  • To unblock yourself, you could also move hydroGOF to Suggests and rework your package to have only a dotted-line dependency on that package for now. – MichaelChirico Jun 24 '23 at 18:04

0 Answers0