my wish list
Created by: vporphyre
Hi Facundo, Sylvain,
please find below the points that I would like to suggest for further improvement of the mapMCDA tool. Hope you will agree with them. Thanks again for this great job and the further upgrades! Cheers Vincent
Tab "Files": please add a button to reset the files list
Tab "Risk factors":
- Please add radio buttons to choose various links for standardization (see script.R at the end of this post, as a suggestion only)
- Please add a button to export the individual standardized "risk scale" maps
Tab "Weigths":
- please display the ranking scale (1/9 to 9 and meanings) for a better understanding of users
- please compute and display the Consistency Ratio
It would be great if you could add the following supplementary tabs (and functions to the package):
- Tab "observed data" to import a .csv or .shp or .gpkg file reporting observed outbreaks (points) or measured prevalences (polygons) for each epidemiological unit, and displaying (and export) related maps (a first raw map and a second epi units' map displaying the presence/absence of outbreaks or displaying the measured risk/prevalence)
- Tab "AUC and ROC curve" to compare risk prediction with observed data
Final point: 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)
# 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)
}