Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UMR-ASTRE
mapMCDA
Commits
6fe06729
Commit
6fe06729
authored
Apr 04, 2019
by
Facundo Muñoz
®️
Browse files
Interface: add help text and improve labels + summary stats epi-units
parent
37b3e6b8
Changes
4
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
6fe06729
Package: mapMCDA
Title: Produce an epidemiological risk map by weighting multiple risk factors
Version: 0.3.
3
Version: 0.3.
4
Date: 2018-06-27
Authors@R: c(
person("Elena", "Arsevska", email = "elena.arsevska@cirad.fr", role = c("ctb")),
...
...
inst/interface/global.R
View file @
6fe06729
...
...
@@ -76,6 +76,27 @@ langFileList <- c("Names","Noms")
langBoxLayer
<-
c
(
"Layers"
,
"Couches"
)
langHelpFiles
<-
c
(
"Import files, including a vector map with epidemiological units."
,
"Importer fichiers, y-compris une carte vectorielle avec des unités épidémiologiques."
)
langHelpLayers
<-
c
(
"Check the epidemiological units layer."
,
"Signaler la couche d'unités épidémiologiques."
)
langHelpScale
<-
c
(
"Harmonise the original scales into a common risk-scale. Use the button to reverse the relationship."
,
"Harmoniser les échelles originales en une échelle de risque commune. Utiliser le bouton pour inverser la relation."
)
langHelpMatrix
<-
c
(
"The factor in row i is x[i,j] times more important than the factor in column j."
,
"Le facteur de la ligne i est x[i, j] fois plus important que le facteur de la colonne j."
)
# Epidemiological unit
langMenuUnit
<-
c
(
"Epidemiological units"
,
"Unités épidémiologiques"
)
...
...
@@ -87,12 +108,12 @@ langBoxUnitStat <- c("Statistics", "Statistiques")
# Risk factors
langMenuRisk
<-
c
(
"Risk factors"
,
"Facteurs de risque"
)
langBoxRiskRawMap
<-
c
(
"
Raw"
,
"Brut
"
)
langBoxRiskRawMap
<-
c
(
"
Original scale"
,
"Échelle originale
"
)
langBoxRiskStandRaster
<-
c
(
"
Standardized raster"
,
"Raster standardisé
"
)
langBoxRiskStandRaster
<-
c
(
"
Risk scale"
,
"Échelle de risque
"
)
langRBRiskLayer
<-
c
(
"S
elect layer to compute standardized raster:
"
,
"
Sélectionnez la couche pour calculer le raster :
"
)
langRBRiskLayer
<-
c
(
"S
cale risk factors
"
,
"
Mise en échelle des facteurs de risque
"
)
langABRiskRasterInvert
<-
c
(
"Invert"
,
"Inverser"
)
...
...
@@ -102,9 +123,9 @@ langABRiskRasterInvert <- c("Invert", "Inverser")
# Weight
langMenuWeight
<-
c
(
"Weight"
,
"Poids"
)
langBoxWeightMatrix
<-
c
(
"
Weight
Matrix"
,
"Matrice de
s poid
s"
)
langBoxWeightMatrix
<-
c
(
"
Pairwise comparison
Matrix"
,
"Matrice de
comparaison par paire
s"
)
langBoxWeightBar
<-
c
(
"Weight
H
istogram"
,
"Histogramme des poids"
)
langBoxWeightBar
<-
c
(
"Weight
s h
istogram"
,
"Histogramme des poids"
)
# Results
langMenuResult
<-
c
(
"Results"
,
"Résultats"
)
...
...
inst/interface/server.R
View file @
6fe06729
...
...
@@ -377,6 +377,34 @@ server <- function(input, output, session) {
})
##### Summary statistics of epid. unit ####
output
$
unitStatText
<-
renderText
({
epidUnitLayer
<-
curEpidUnitLayer
()
if
(
is.null
(
epidUnitLayer
))
return
(
NULL
)
if
(
!
is.projected
(
epidUnitLayer
[[
indRawLay
]]))
{
warning
(
"This map is not projected. This can lead to very
inaccurate computations of distances and areas, depending
on the location and size of the region of interest.
Proceed with caution."
)
}
# htmlOutput(
paste
(
"N. epidemiological units:"
,
length
(
epidUnitLayer
[[
indRawLay
]]))
# )
})
output
$
unitStatDisplay
<-
renderPlot
({
epidUnitLayer
<-
curEpidUnitLayer
()
if
(
is.null
(
epidUnitLayer
))
return
(
NULL
)
hist
(
rgeos
::
gArea
(
cmr
$
cmr_admin3
,
byid
=
TRUE
),
main
=
"Distribution of unit-areas"
,
xlab
=
"Area (in map units, squared)"
)
})
##### Render for the list of layers in risk tab ####
output
$
uiRiskLayerList
<-
renderUI
({
...
...
inst/interface/ui.R
View file @
6fe06729
...
...
@@ -36,114 +36,161 @@ body <- dashboardBody(
tabItem
(
"fileTab"
,
fluidRow
(
box
(
title
=
HTML
(
langBoxFile
[
indLang
]),
status
=
"primary"
,
width
=
5
,
solidHeader
=
TRUE
,
## File load
box
(
title
=
HTML
(
langBoxFile
[
indLang
]),
status
=
"primary"
,
width
=
5
,
solidHeader
=
TRUE
,
footer
=
langHelpFiles
[
indLang
],
# To upload shape and raster files
fileInput
(
inputId
=
"fiLayer"
,
label
=
HTML
(
langTitleFileInput
[
indLang
]),
multiple
=
TRUE
,
accept
=
NULL
,
#acceptLayerType,
width
=
NULL
,
buttonLabel
=
HTML
(
langButtonFileInput
[[
indLang
]][
1
]),
placeholder
=
HTML
(
langButtonFileInput
[[
indLang
]][
2
])),
fileInput
(
inputId
=
"fiLayer"
,
label
=
HTML
(
langTitleFileInput
[
indLang
]),
multiple
=
TRUE
,
accept
=
NULL
,
#acceptLayerType,
width
=
NULL
,
buttonLabel
=
HTML
(
langButtonFileInput
[[
indLang
]][
1
]),
placeholder
=
HTML
(
langButtonFileInput
[[
indLang
]][
2
])
),
# List of all upload files
tableOutput
(
"allFileTable"
)
),
box
(
title
=
HTML
(
langBoxLayer
[
indLang
]),
status
=
"success"
,
width
=
7
,
solidHeader
=
TRUE
,
# List of layers. Name is editable
rHandsontableOutput
(
"rhLayerTable"
)
)
)
),
tabItem
(
"unitTab"
,
uiOutput
(
"unitNameText"
),
box
(
title
=
HTML
(
langBoxUnitMap
[
indLang
]),
status
=
"primary"
,
width
=
6
,
solidHeader
=
TRUE
,
plotOutput
(
"unitMapDisplay"
)
),
box
(
title
=
HTML
(
langBoxUnitStat
[
indLang
]),
status
=
"success"
,
width
=
6
,
solidHeader
=
TRUE
,
),
## Layer table
box
(
title
=
HTML
(
langBoxLayer
[
indLang
]),
status
=
"success"
,
width
=
7
,
solidHeader
=
TRUE
,
footer
=
langHelpLayers
[
indLang
],
plotOutput
(
"unitStatDisplay"
)
# List of layers. Name is editable
rHandsontableOutput
(
"rhLayerTable"
)
)
)
),
tabItem
(
"unitTab"
,
uiOutput
(
"unitNameText"
),
box
(
title
=
HTML
(
langBoxUnitMap
[
indLang
]),
status
=
"primary"
,
width
=
6
,
solidHeader
=
TRUE
,
plotOutput
(
"unitMapDisplay"
)
),
box
(
title
=
HTML
(
langBoxUnitStat
[
indLang
]),
status
=
"success"
,
width
=
6
,
solidHeader
=
TRUE
,
textOutput
(
"unitStatText"
),
plotOutput
(
"unitStatDisplay"
)
)
),
tabItem
(
"riskTab"
,
uiOutput
(
"uiRiskLayerList"
),
tabItem
(
"riskTab"
,
uiOutput
(
"uiRiskLayerList"
),
box
(
title
=
HTML
(
langBoxRiskRawMap
[
indLang
]),
status
=
"primary"
,
width
=
6
,
solidHeader
=
TRUE
,
plotOutput
(
"rawLayerDisplay"
)
),
box
(
title
=
HTML
(
langBoxRiskStandRaster
[
indLang
]),
status
=
"success"
,
width
=
6
,
solidHeader
=
TRUE
,
plotOutput
(
"standRasterDisplay"
)
),
box
(
status
=
"info"
,
width
=
6
,
solidHeader
=
FALSE
,
langHelpScale
[
indLang
]
),
actionButton
(
inputId
=
"abInvert"
,
label
=
langABRiskRasterInvert
[
indLang
]
)
),
tabItem
(
"weightTab"
,
box
(
title
=
HTML
(
langBoxRiskRawMap
[
indLang
]),
status
=
"primary"
,
width
=
6
,
solidHeader
=
TRUE
,
fluidRow
(
box
(
title
=
HTML
(
langBoxWeightMatrix
[
indLang
]),
status
=
"primary"
,
width
=
9
,
solidHeader
=
TRUE
,
plotOutput
(
"rawLayerDisplay"
)
),
box
(
title
=
HTML
(
langBoxRiskStandRaster
[
indLang
]),
status
=
"success"
,
width
=
6
,
solidHeader
=
TRUE
,
rHandsontableOutput
(
"rhWeightTable"
)
#,
# actionButton(inputId = "abWMatrixOK", label = "Valider"),
#
# textOutput("isMatrixOKText")
plotOutput
(
"standRasterDisplay"
)
),
actionButton
(
inputId
=
"abInvert"
,
label
=
langABRiskRasterInvert
[
indLang
])
),
tabItem
(
"weightTab"
,
fluidRow
(
),
box
(
title
=
HTML
(
langBoxWeightMatrix
[
indLang
]),
status
=
"primary"
,
width
=
12
,
solidHeader
=
TRUE
,
rHandsontableOutput
(
"rhWeightTable"
)
#,
# actionButton(inputId = "abWMatrixOK", label = "Valider"),
#
# textOutput("isMatrixOKText")
)
box
(
status
=
"info"
,
width
=
3
,
solidHeader
=
FALSE
,
langHelpMatrix
[
indLang
]
)
),
fluidRow
(
box
(
title
=
HTML
(
langBoxWeightBar
[
indLang
]),
status
=
"success"
,
width
=
12
,
solidHeader
=
TRUE
,
plotOutput
(
"weightBarDisplay"
)
box
(
title
=
HTML
(
langBoxWeightBar
[
indLang
]),
status
=
"success"
,
width
=
12
,
solidHeader
=
TRUE
,
plotOutput
(
"weightBarDisplay"
)
)
)
)
),
)),
tabItem
(
"resultTab"
,
box
(
title
=
HTML
(
langMenuResult
[
indLang
]),
status
=
"primary"
,
width
=
6
,
solidHeader
=
TRUE
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment