r-spatialecology/landscapemetrics

Dependencies

Closed this issue · 9 comments

Hi @mhesselbarth -- I got an email about a problem: a user has R v 4.2.1, but cannot install landscapemetrics, due to the Rcpp (≥ 1.0.10) requirement (I assume this Rcpp version is only available for R>4.2.1). Is this requirement is actually needed?

Mmh...Good question. When I fixed the C+11 requirement which we had previously, but didn't need and threw an warning on CRAN they asked me to fix, I looked at and copied everything from Rcpp::Rcpp.package.skeleton() to make sure everything is setup correctly. I think it basically comes down to if we need a Makevars file or not, which is optional starting from a certain version of Rcpp

Maybe this is also a good issue to discuss Suggest and Enhances in general.

So we need packages as suggest to use them in tests I think. This means, listing raster and sp only in Enhances doesn't allow us to really test them.

Should we just get rid of Enhance completely and list them all as Suggest? Given that those won't be necessarily installed for all users, I think that might be alright?

The difference between Enhance and Suggests is that Enhance should only have packages for which we added new methods (e.g, landscape_as_list.stars), but we are not testing them nor using them in examples. So -- in general, yes -- we could just move everything to Suggests

So the advantages would be we could actually test them and use them in examples. What would be the disadvantage? A bit heaver installation if vignettes = TRUE (or similar arguments during installation)?

Yep -- that how I understand it.

@mhesselbarth I would suggest removing the Rcpp version check from Description.

For people having problems with installing landscapemetrics, this following code should work:

install.packages('landscapemetrics', repos = c('https://r-spatialecology.r-universe.dev/', 'https://cloud.r-project.org/'))

Everything should be fixed now.

  1. We depend on Rcpp (>= 0.11.0) and R (>= 3.6) due to the CRAN C++11 policy. And I think both version requirements are fair at this point in terms of compatibility with older versions.
  2. I moved all Enhances to Suggests.
  3. pgkdown should run again, however, I added a note that the comparison vignettes is currently out-of-date because we need to re-calc the metrics

Great work! Thanks @mhesselbarth