Closed fdschneider closed 9 years ago
@guttal @ssumithra @SabihaMajumder
The spatial_warnings repository is not a valid R package. It rather is a set of R functions that have to be downloaded and sourced. It is not straightforward to call it as a dependency and use it within our package. I see two options:
Good point -- yes, spatial_ews is just a set of functions. Pros and cons of each of those options is very clear. Option (B) is ideal, although fixing that package is not quite the priority right now. Is it sufficiently easy to convert the existing set of functions to a package in R? If you could give pointers, I will discuss with Sabiha or sumithra to see if they would have time to do it.
It is quite easy to wrap an R package from that. The online book by Hadley Wickham is an excellent introduction using RStudio. But basically you only need to
source()
and require()
calls within the functions. All files in subdirectory R will be sourced. The current documentation should be sufficient. the package can be built using R CMD build
(from command line).
The package then will be included as a dependency of caspr.
I just forked the repository and built a package from it: see here. But I still need to figure out how to call it from within caspr.
The input for the functions provided in the spatialwarnings package is a binary matrix. We needed a wrapper that transfers the landscape object into a binary matrix and then applies the function spatialwarnings::spatial_ews()
.
By commit 5b168620 this is now realised in the S3 methods of function indicators()
for individual landscape objects as well as for output of the ca()
, but as far as I see this only works for square landscape objects! .
Note: I had to disable the automatic plotting of a visual report in spatialwarnings::spatial_ews()
.
link function to spatial indicators package