Closed agila5 closed 3 years ago
Merging #138 (236318a) into master (4a65a02) will increase coverage by
0.00%
. The diff coverage is57.69%
.
@@ Coverage Diff @@
## master #138 +/- ##
=======================================
Coverage 86.19% 86.20%
=======================================
Files 20 20
Lines 1326 1341 +15
=======================================
+ Hits 1143 1156 +13
- Misses 183 185 +2
Impacted Files | Coverage Δ | |
---|---|---|
R/sfnetwork.R | 86.32% <50.00%> (-1.40%) |
:arrow_down: |
R/spatstat.R | 60.00% <60.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 4a65a02...236318a. Read the comment docs.
I think it's ready to be reviewed/merged.
IMO the only problem is that it introduces a "strong" dependency on sf >= 0.9.8
(and also an ugly startup message related to spatstat.geom
). Hence, I have the following proposal. I am probably the only one that takes advantage of the integration between sfnetworks
and spatstat
. So, maybe, we could purge all spatstat
code from sfnetworks
, and then I will create a new (small but with a lot of dependencies) package that extends sfnetworks
. Opinions?
I am probably the only one that takes advantage of the integration between sfnetworks and spatstat
Not sure about that! I think it is great to have integration with other packages. I was planning to implement similar integration with e.g. spdep
.
What is the reason we need the sf dependency? I don't see sf functions being called in your code (but might have looked over them). If we need it, I would suggest to check for the sf version in the check_spatstat
function, rather than setting the depedency for the whole package.
Regarding the startup message, you refer to this one?
Registered S3 method overwritten by 'spatstat':
method from
print.boxx cli
I think we can call s3_register("spatstat.linnet::as.linnet", "sfnetwork")
inside suppressPackageStartupMessages()
to avoid that, but not sure if that is good practice.
What is the reason we need the sf dependency? I don't see sf functions being called in your code (but might have looked over them).
The method for converting sf
objects (with POINT
geometry) into ppp
objects is defined here and used here
The method for converting psp
(and linnet
) objects into sf
objects is defined here and used here
The problem is that the code in the sf
package version 0.9.7 fails because it calls spatstat
functions that were transferred to a different package.
If we need it, I would suggest to check for the sf version in the check_spatstat function, rather than setting the depedency for the whole package.
Agree. Changed with the last commit.
Regarding the startup message, you refer to this one?
Yes
I think we can call s3_register("spatstat.linnet::as.linnet", "sfnetwork") inside suppressPackageStartupMessages() to avoid that, but not sure if that is good practice.
I added a call to suppressPackageStartupMessages()
, feel free to remove that.
Fix #137.
Finally, it seems that it's working. I will complete the PR as soon as
sf
0.9.8 is on CRAN (the 0.9.7 version is already failing). The only downside is that (I think) we have to add a dependency on the 0.9.8 version ofsf
or, at least, test thesf
version in the spatstat-related code. Do you think it's a problem?