mapMCDA issueshttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues2024-03-19T11:33:31+01:00https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/20Add button to reset file list2024-03-19T11:33:31+01:00Facundo MuñozAdd button to reset file list*Created by: famuvie*
Feature request by @vporphyre in #19*Created by: famuvie*
Feature request by @vporphyre in #19mapMCDA hackathonhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/22Allow exporting the maps of individual risk factors in risk-scale2019-04-10T14:43:29+02:00Facundo MuñozAllow exporting the maps of individual risk factors in risk-scale*Created by: famuvie*
Feature requested by @vporphyre in #19
*Created by: famuvie*
Feature requested by @vporphyre in #19
https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/21Alternative risk-scaling functions2024-03-18T14:52:59+01:00Facundo MuñozAlternative risk-scaling functions*Created by: famuvie*
Currently, the only scaling functions are linear, with the option to be reversed.
Please add radio buttons to choose various links for standardization (see code at the end of this post, as a suggestion only)
Feat...*Created by: famuvie*
Currently, the only scaling functions are linear, with the option to be reversed.
Please add radio buttons to choose various links for standardization (see code at the end of this post, as a suggestion only)
Feature requested by @vporphyre in #19
```r
# function link_fun (à integrer dans risk_layer à la place de lin_fun) BETA VERSION (V.Porphyre) ####
# arg invert à associer au bouton 'Inverser'
# x1 and x2 Threshold values
lin_fun <- function(r, type="linear", invert=FALSE, x1=0, x2=0, source=scale_source, target=scale_target){
if (type=="linear"){
slope <- diff(target)/diff(source)
ans <- target[1] + slope * (r - source[1])
}
if (type=="crisp"){ tmp <- r
if (invert==FALSE) {
tmp[tmp<x1] <- target[1]
tmp[tmp>=x1] <- target[2]
}
if (invert==TRUE){
tmp[tmp<x1] <- target[2]
tmp[tmp>=x1] <- target[1]
}
ans <- tmp
}
if (type=="double"){ tmp <- r
if(invert==FALSE){
tmp[tmp<x1] <- target[1]
tmp[tmp>=x1 & tmp<x2] <- target[2]
tmp[tmp>=x2] <- target[1]}
if(invert==TRUE){
tmp[tmp<x1] <- target[2]
tmp[tmp>=x1 & tmp<x2] <- target[1]
tmp[tmp>=x2] <- target[2]
}
ans <- tmp
}
# if (type=="fuzzy"){} # to be developped
# if (type=="sigmoid"){
# #ans <- target[2]*(1/(1 + ((1/target[1])-1)*exp(-x1*r)))
# } # WRONG
return(ans)
}
```mapMCDA hackathonhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/37Test coverage2024-03-15T14:40:16+01:00Facundo MuñozTest coverage*Created by: famuvie*
Set up systematic test coverage analysis (`covr`)*Created by: famuvie*
Set up systematic test coverage analysis (`covr`)mapMCDA hackathonhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/35Vignette "mapMCDA" (Get Started): update2024-03-18T12:31:56+01:00Facundo MuñozVignette "mapMCDA" (Get Started): update*Created by: famuvie**Created by: famuvie*mapMCDA hackathonDavid PleydellDavid Pleydellhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/36Optimise package dependencies2023-10-20T17:02:22+02:00Facundo MuñozOptimise package dependencies*Created by: famuvie*
We currently (v0.4-10) depend directly on 19 packages. Taking into account the recursive dependencies, this implies a longer installation time and more importantly, a lot of opportunities for problems at installati...*Created by: famuvie*
We currently (v0.4-10) depend directly on 19 packages. Taking into account the recursive dependencies, this implies a longer installation time and more importantly, a lot of opportunities for problems at installation or working time.
Furthermore, I'm quite sure that many dependencies have been introduced for convenience, but can be easily circumvented (e.g. `stringr`).
- [ ] Assess the relevance of each dependency
- [ ] Reduce dependencies as much as possiblehttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/7Allow adding/removing files/layers2019-04-12T17:26:14+02:00Facundo MuñozAllow adding/removing files/layers*Created by: famuvie*
Adding files can be done clicking the button again. But some check for duplicates is needed.
A functionality for removing files and layers is missing, though.
*Created by: famuvie*
Adding files can be done clicking the button again. But some check for duplicates is needed.
A functionality for removing files and layers is missing, though.
CRAN Releasehttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/34Vignette: assessment of uncertainty2019-04-24T15:56:58+02:00Facundo MuñozVignette: assessment of uncertainty*Created by: famuvie*
Produce a **worked-out case study on uncertainty quantification**.
This needs to be done programmatically (i.e. without the interface). Make explicit the inputs that have some uncertainty (basically, the weights...*Created by: famuvie*
Produce a **worked-out case study on uncertainty quantification**.
This needs to be done programmatically (i.e. without the interface). Make explicit the inputs that have some uncertainty (basically, the weights) and make a function that produces the risk map given an input.
Make some sensible assumptions about the uncertainty on the weights and produce maps from a sample of possible weights.
Finally, compute some maps summarising the weighted average risk map and quartile maps, sd maps, etc.https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/30Stand-alone version of the package2019-04-12T09:50:16+02:00Facundo MuñozStand-alone version of the package*Created by: famuvie*
Provide a downloadable compiled binary package that encapsulates R, Shiny, mapMCDA and its dependencies into a stand-alone executable program.
This is costly to produce and set-up. Especially for several platfor...*Created by: famuvie*
Provide a downloadable compiled binary package that encapsulates R, Shiny, mapMCDA and its dependencies into a stand-alone executable program.
This is costly to produce and set-up. Especially for several platforms. But it would greatly improve the experience of users that are unfamiliar with R and need to install it only for the purpose of the package.https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/29Interface: capture errors and warnings and display in GUI2023-12-18T16:24:30+01:00Facundo MuñozInterface: capture errors and warnings and display in GUI*Created by: famuvie*
Currently, errors and warnings appear in the R console.
In particular, errors turns the GUI gray and the process is blocked, forcing the user to go to the console to read the message and stop the process in order ...*Created by: famuvie*
Currently, errors and warnings appear in the R console.
In particular, errors turns the GUI gray and the process is blocked, forcing the user to go to the console to read the message and stop the process in order to start over.
Capture the errors and warnings using `try()` in all function calls from the interface, and redirect them to graphical pop-up boxes with proper actions offered to the user to fix the issue and continue without going back to the cosole.https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/28Extension of conceptual model with non-linearities. Interactions, logistic sc...2020-02-06T13:09:47+01:00Facundo MuñozExtension of conceptual model with non-linearities. Interactions, logistic scale, OWA.*Created by: famuvie*
Several risk-managers have expressed concern for the limited scope of the additive model. They argue that the relevance of some risks factors depend on the presence or the magnitude of other risk factors. For insta...*Created by: famuvie*
Several risk-managers have expressed concern for the limited scope of the additive model. They argue that the relevance of some risks factors depend on the presence or the magnitude of other risk factors. For instance, the animal mobility presents an actual risk only in regions with high animal density, or maybe in regions in the borders of the country, etc.
These arguments sound sensible to me. They are talking about interactions between factors.
1. Once all the risk factors are loaded and scaled, we could offer the possibility to add interactions between them by multiplying the risk maps and incorporating these products as additional (additive) terms. Just as in any regression model. Then, the user can weight the importance of the "main effects" and also of these interactions.
2. Since the final outcome is a risk map with values in an interval [say (0,1), for the matter], it would make sense to model the contributions in a logit scale and the scale back to risk-scale.
This would introduce dependence among all factors (the "effect" of A depends on the value of B). But is not exactly an interaction (if B has a very low risk, the effect of A is exaggerated, rather than suppressed).
In fact, (2) will simply exaggerate extreme risks and attenuate average risks. I worry whether it would be too much. On the other hand, the manual assignment of weights to the factors becomes more difficult because of the change of scale. I need to think about this and make some tests.
Both changes are thus complementary, and the whole model would share the structure of a logistic regression. This has the appeal that it is more comparable to a model fit with data. Moreover, this allows to interpret the whole approach as a model fit only with priors on the parameters, handle the uncertainty more formally and allow to build upon the prior risk-maps with observed data.
https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/25Save a log/report with inputs and parameters used in the analysis2024-03-15T14:40:15+01:00Facundo MuñozSave a log/report with inputs and parameters used in the analysis*Created by: famuvie*
It would be useful to display in console the R code generated in RShiny interface and/or to produce a log report, ie. with layers considered, link used for standardisation, weights computed for each risk factors, c...*Created by: famuvie*
It would be useful to display in console the R code generated in RShiny interface and/or to produce a log report, ie. with layers considered, link used for standardisation, weights computed for each risk factors, consistency ratio, destination references to produced files (for archiving or further modifications)
Feature requested by @vporphyre in #19mapMCDA hackathonhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/26Optimisation: rasterise region once2019-04-11T14:16:37+02:00Facundo MuñozOptimisation: rasterise region once*Created by: famuvie*
Currently, when several vector maps are used as risk factors, the function `distance_map()` is called for each one. This function determines the region of interest by rasterising the map of epidemiological units.
...*Created by: famuvie*
Currently, when several vector maps are used as risk factors, the function `distance_map()` is called for each one. This function determines the region of interest by rasterising the map of epidemiological units.
This operation should be done once for all.https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/23Weights scale2019-04-18T09:56:54+02:00Facundo MuñozWeights scale*Created by: famuvie*
Please display the ranking scale (1/9 to 9 and meanings) for a better understanding of users
Feature request by @vporphyre in #19*Created by: famuvie*
Please display the ranking scale (1/9 to 9 and meanings) for a better understanding of users
Feature request by @vporphyre in #19https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/38Compute and display the Consistency Ratio of the pairwise comparison matrix.2024-03-18T16:31:01+01:00Facundo MuñozCompute and display the Consistency Ratio of the pairwise comparison matrix.While the user fills the pairwise comparison matrix, compute and display its Consistency Ratio (CR, Saaty, 1987; Drobne and Lisec, 2009) in real time.
Include some guidance text to help interpreting the CR.
Ideally, identify in the matri...While the user fills the pairwise comparison matrix, compute and display its Consistency Ratio (CR, Saaty, 1987; Drobne and Lisec, 2009) in real time.
Include some guidance text to help interpreting the CR.
Ideally, identify in the matrix which particular values are most responsible for the eventual inconsistencies of the matrix.mapMCDA hackathonDavid PleydellDavid Pleydellhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/39Correlation matrix of risk factors2024-03-15T14:40:16+01:00Facundo MuñozCorrelation matrix of risk factorsAutomatically compute and display a correlation matrix of risk factors.
Warn whenever two factors are highly correlated (define highly). Suggest possible actions (e.g. remove one, or compute a summary of both).Automatically compute and display a correlation matrix of risk factors.
Warn whenever two factors are highly correlated (define highly). Suggest possible actions (e.g. remove one, or compute a summary of both).mapMCDA hackathonFacundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/40Undeclared dependency on package {fs}2024-03-15T14:39:43+01:00Facundo MuñozUndeclared dependency on package {fs}Currently using `fs::path_home()` in `server.R`.
Consider (and test) whether it can be replaced by `base::path.expand("~")` or either declare the dependency.
The difference is in Windows only. `path_home` points to `C:\Users\<user>` whil...Currently using `fs::path_home()` in `server.R`.
Consider (and test) whether it can be replaced by `base::path.expand("~")` or either declare the dependency.
The difference is in Windows only. `path_home` points to `C:\Users\<user>` while `path.expand()` points to the `Documents` folder within the former.mapMCDA hackathonSylvain VillaudySylvain Villaudyhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/42Docker distribution of mapMCDA2020-05-09T17:08:19+02:00Facundo MuñozDocker distribution of mapMCDASee https://github.com/noamross/nyhackr-docker-talk/blob/master/Noam_Ross_DockerForTheUseR_nyhackr_2018-07-10.pdfSee https://github.com/noamross/nyhackr-docker-talk/blob/master/Noam_Ross_DockerForTheUseR_nyhackr_2018-07-10.pdfDocker apphttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/43Interface header2020-05-09T17:10:07+02:00Facundo MuñozInterface headerAdd logo and version.
Write mapMCDA instead of MapMCDA.Add logo and version.
Write mapMCDA instead of MapMCDA.https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/45Reporting functionality2020-05-27T11:01:27+02:00Facundo MuñozReporting functionalityFeature request: Ability to export a complete analysis to a full report in pdf, html or Word format.Feature request: Ability to export a complete analysis to a full report in pdf, html or Word format.Facundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/46Marginal distribution of risk factors and final risk.2020-05-27T11:16:56+02:00Facundo MuñozMarginal distribution of risk factors and final risk.It would be useful to display a histogram or density estimate of risk factors (in the original and the risk scales).
Moreover, when different scaling functions are implemented, these densities can be integrated in the same graph.It would be useful to display a histogram or density estimate of risk factors (in the original and the risk scales).
Moreover, when different scaling functions are implemented, these densities can be integrated in the same graph.Facundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/47Rasterise a network with all nodes beyond boundaries: give informative error.2020-05-29T18:45:13+02:00Facundo MuñozRasterise a network with all nodes beyond boundaries: give informative error.This is a common mistake, for example when data contains switched coordinates. However, the error message is unhelpful.
MRE:
``` r
library(mapMCDA)
library(raster)
#> Loading required package: sp
r <- raster(nrow = 10, ncol = 10, xmn = ...This is a common mistake, for example when data contains switched coordinates. However, the error message is unhelpful.
MRE:
``` r
library(mapMCDA)
library(raster)
#> Loading required package: sp
r <- raster(nrow = 10, ncol = 10, xmn = 0, xmx = 10, ymn = 0, ymx = 10, vals = 1)
## A geonetwork with all nodes beyond boundaries
## A -> B; A -> C; A -> D
edges <- data.frame(
O = rep("A", 3),
D = LETTERS[2:4],
stringsAsFactors = FALSE
)
nodes <- data.frame(
node = LETTERS[1:4],
x = rep(c(-2, 12), times = 2),
y = c(2, 2, 11, 8)
)
gn <- geonetwork::geonetwork(edges, nodes)
plot(1, xlim = c(-5, 15), ylim = c(-5, 15), type = "n")
plot(r, add = TRUE, legend = FALSE)
plot(gn, add = TRUE)
```
![](https://i.imgur.com/gyuwcgH.png)
``` r
rasterize(gn, r)
#> Point being added:
#> [1] 2
#> Error in deldir::deldir(xy[, 1], xy[, 2], rw = ext, eps = eps, suppressMsge = TRUE): Cannot find an enclosing triangle. See help for deldir.
```
<sup>Created on 2020-05-29 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)</sup>
Expected behaviour: Identify the error and provide an informative message for the user.Facundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/49Include a measure of variability into the final risk map at epidemiological u...2020-06-05T12:45:11+02:00Facundo MuñozInclude a measure of variability into the final risk map at epidemiological unit levels.We currently aggregate risk at epidemiological unit level by averaging over the area of the unit and include a new variable further categorised by risk level.
Consider including the average risk and a measure of variability (such as sd)....We currently aggregate risk at epidemiological unit level by averaging over the area of the unit and include a new variable further categorised by risk level.
Consider including the average risk and a measure of variability (such as sd).
Thanks to Claudia Pittiglio from FAO.Facundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/50Handle RasterBrick objects in risk_unit()2020-09-25T12:50:47+02:00Facundo MuñozHandle RasterBrick objects in risk_unit()`risk_unit(r, eu)` computes the average risk at epidemiological unit taking a Raster as input and a vector map of epi-units.
If r is a `RasterBrick`, `risk_unit()` currently uses the first layer.
For uncertainty quantification, it would ...`risk_unit(r, eu)` computes the average risk at epidemiological unit taking a Raster as input and a vector map of epi-units.
If r is a `RasterBrick`, `risk_unit()` currently uses the first layer.
For uncertainty quantification, it would be useful to return a matrix instead of a vector, with as many columns as layers.
For type consistency, it would be better to return always a matrix, even in the case of single-column.
``` r
library(mapMCDA)
library(raster, quietly = TRUE)
packageVersion("mapMCDA")
#> [1] '0.4.52'
r <- raster(xmn=-110, xmx=-90, ymn=40, ymx=60, nrow = 10, ncol = 10)
r <- setValues(r, seq.int(ncell(r)))
## polygons covering the region by squares of 2x2 pixels
r0 <- r
res(r0) <- 2*res(r)
epiunits <- as(r0, "SpatialPolygons")
risk_unit(r, epiunits)
#> [1] 6.5 8.5 10.5 12.5 14.5 26.5 28.5 30.5 32.5 34.5 46.5 48.5 50.5 52.5 54.5
#> [16] 66.5 68.5 70.5 72.5 74.5 86.5 88.5 90.5 92.5 94.5
risk_unit(brick(r, 2*r, 3*r), epiunits)
#> [1] 6.5 8.5 10.5 12.5 14.5 26.5 28.5 30.5 32.5 34.5 46.5 48.5 50.5 52.5 54.5
#> [16] 66.5 68.5 70.5 72.5 74.5 86.5 88.5 90.5 92.5 94.5
```
<sup>Created on 2020-09-25 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)</sup>Facundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/51Perform risk scaling after clipping, not before.2024-03-15T16:39:28+01:00Facundo MuñozPerform risk scaling after clipping, not before.The transformation into risk scale seems to be taking place before clipping to the region.
If a large raster is used, the variation within the region might be rescaled into a very small interval.The transformation into risk scale seems to be taking place before clipping to the region.
If a large raster is used, the variation within the region might be rescaled into a very small interval.Facundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/52More flexible processing vector layers2021-02-11T09:42:11+01:00Facundo MuñozMore flexible processing vector layersFor any __vector__ input `mapMCDA` currently considers only its __geometry__ and computes the distance map to the spatial features it contains, disregarding its attribute table, if any.
However, sometimes users need to use some spatial ...For any __vector__ input `mapMCDA` currently considers only its __geometry__ and computes the distance map to the spatial features it contains, disregarding its attribute table, if any.
However, sometimes users need to use some spatial variable that is spatially aggregated into an attribute of some vector map. They need to rasterize the attribute externally and feed the resulting raster into mapMCDA.
We could offer the possibility of doing this automatically, at the moment of scaling. We can default to the current distance map and, whenever there is an attribute table, offer the possibility to rasterise any of the quantitative variables.Facundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/53RStudio addin for launching mapMCDA2024-03-18T12:31:31+01:00Facundo MuñozRStudio addin for launching mapMCDAWrite an RStudio add-in so that mapMCDA can be launched from the Addins menu.
See e.g. https://www.youtube.com/watch?v=7L3hDpLw53I&list=PLNhtaetb48EedDmWPUqytnQv-qxmCGtxi&index=4Write an RStudio add-in so that mapMCDA can be launched from the Addins menu.
See e.g. https://www.youtube.com/watch?v=7L3hDpLw53I&list=PLNhtaetb48EedDmWPUqytnQv-qxmCGtxi&index=4mapMCDA hackathonetienne.loireetienne.loirehttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/57Support geojson as a valid vector format.2024-03-18T11:02:35+01:00Facundo MuñozSupport geojson as a valid vector format.mapMCDA hackathonFacundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/58Raster processing: crop-scale or scale-crop?2024-03-15T16:30:17+01:00Facundo MuñozRaster processing: crop-scale or scale-crop?Check in what order mapMCDA processes rasters.
I think [1] it first scales linearly from 0 to 100 the input raster and then it crops to the target region.
Arguably, it should be the converse.
[1] After seeing the processing of the anim...Check in what order mapMCDA processes rasters.
I think [1] it first scales linearly from 0 to 100 the input raster and then it crops to the target region.
Arguably, it should be the converse.
[1] After seeing the processing of the animal-density raster in Nigeria.mapMCDA hackathonFacundo MuñozFacundo Muñozhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/59Interface: add a "Continue" button on each page2024-03-18T15:05:58+01:00Facundo MuñozInterface: add a "Continue" button on each pageHelp the user move on to the next step by offering a button to "Continue" that is enabled only when the current tasks are completeHelp the user move on to the next step by offering a button to "Continue" that is enabled only when the current tasks are completemapMCDA hackathonhttps://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/61Prevent the situation when the scaling has not been performed for all risk fa...2024-01-08T17:08:27+01:00Facundo MuñozPrevent the situation when the scaling has not been performed for all risk factors.Currently, the user can jump directly to the Results section without going through all the factors in the "Risk factors" step. In this case, the final risk map does not display, without any indication of the problem.
Detect the situatio...Currently, the user can jump directly to the Results section without going through all the factors in the "Risk factors" step. In this case, the final risk map does not display, without any indication of the problem.
Detect the situation and, at the very least, provide a message.https://forgemia.inra.fr/umr-astre/mapMCDA/-/issues/62Support importing a CSV with point coordinates2024-01-09T17:20:19+01:00Facundo MuñozSupport importing a CSV with point coordinatesIf the CSV file contains only 2 numerical columns, assume that these are latitude and longitude (in that order) in decimal degrees on WGS84, transform into a vector of points and import as a vector object with a Warning.
There is some i...If the CSV file contains only 2 numerical columns, assume that these are latitude and longitude (in that order) in decimal degrees on WGS84, transform into a vector of points and import as a vector object with a Warning.
There is some interest for this use case.