Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
forest_economics_goettingen
optimLanduse_Shiny
Commits
b0716ebe
Commit
b0716ebe
authored
Oct 26, 2020
by
gross47
Browse files
Merge branch 'master' of
https://gitlab.gwdg.de/gross47/optimlanduse_shiny
parents
0ab1dea6
22c86f30
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Kopie von 08082018_Opti_Indon_Kai.xlsx
deleted
100644 → 0
View file @
0ab1dea6
File deleted
app.R
deleted
100644 → 0
View file @
0ab1dea6
library
(
shiny
)
ui
<-
source
(
"./ui.R"
)
server
<-
source
(
"./server.R"
)
shinyApp
(
ui
=
ui
,
server
=
server
)
\ No newline at end of file
calcDistanceToPerformanceScenario.R
deleted
100644 → 0
View file @
0ab1dea6
##--#####################################################--##
#### Attach portfolio performance and distance to target ####
##--#####################################################--##
# Wed Jan 29 16:19:22 2020 ------------------------------
# Kai Husmann
#' Attach portfolio performance and distance to target
#'
#' The function calculates and attaches the portfolio performance and distance to target. See Gosling et al. Equations 10 and 11.
#' @param x An optimized optimLanduse object.
#'@export
calcDistanceToPerformanceScenario
<-
function
(
x
)
{
if
(
!
all
(
names
(
x
$
scenarioTable
[,
startsWith
(
names
(
x
$
scenarioTable
),
"adj"
)])
==
paste0
(
"adjSem"
,
names
(
x
$
landUse
))))
{
cat
(
"Error: Unexpected variables in the scenario table."
)
}
if
(
!
x
$
status
==
"optimized"
)
{
cat
(
"Error: No optimim found. Did you call solveScenario?"
)}
#---------------------------------#
#### Add portfolio performance ####
#---------------------------------#
# See e.g. Gosling et al. Eq. 10
#rep(averageNomimalIndicatorValue[1 ,], each = dim(scenarioTable)[1])
x
$
scenarioTable
$
portfolioPerformance
<-
apply
(
do.call
(
rbind
,
replicate
(
dim
(
x
$
scenarioTable
)[
1
],
x
$
landUse
[
1
,],
simplify
=
FALSE
))
*
x
$
scenarioTable
[,
startsWith
(
names
(
x
$
scenarioTable
),
"adj"
)],
1
,
sum
)
#------------------------------------------#
#### Add distance to target performance ####
#------------------------------------------#
# See. e.g. Gosling et al. Eq. 11
x
$
scenarioTable
<-
x
$
scenarioTable
%>%
mutate
(
distanceToTargetPerformance
=
1
-
ifelse
(
direction
==
"more is better"
,
((
portfolioPerformance
-
minAdjSem
)
/
diffAdjSem
),
((
maxAdjSem
-
portfolioPerformance
)
/
diffAdjSem
)))
x
$
status
<-
"optimized - information updated"
return
(
x
)
}
rsconnect/shinyapps.io/vongross/applicationOfThePackage.dcf
deleted
100644 → 0
View file @
0ab1dea6
name: applicationOfThePackage
title: applicationOfThePackage
username:
account: vongross
server: shinyapps.io
hostUrl: https://api.shinyapps.io/v1
appId: 2497473
bundleId: 3310870
url: https://vongross.shinyapps.io/applicationOfThePackage/
when: 1593001607.9347
asMultiple: FALSE
asStatic: FALSE
ignoredFiles: A|B|tt-frim-home.RData|3 performanceTest/applyPackage.R|1 simulateDataSource|2 applyOptimizations
rsconnect/shinyapps.io/vongross/
app_1
.dcf
→
rsconnect/shinyapps.io/vongross/
optimlanduse_shiny
.dcf
View file @
b0716ebe
name:
app_1
name:
optimlanduse_shiny
title:
username:
account: vongross
server: shinyapps.io
hostUrl: https://api.shinyapps.io/v1
appId: 2497524
bundleId: 3311994
url: https://vongross.shinyapps.io/app_1/
when: 1593017851.0568
asMultiple: FALSE
asStatic: FALSE
appId: 3090351
bundleId: 3780081
url: https://vongross.shinyapps.io/optimlanduse_shiny/
when: 1603629504.65333
server.R
View file @
b0716ebe
#
# dat <- read_excel("database.xlsx", sheet = "data", col_names = FALSE)
#
# dataSource <- datainput(dat, uncertainty = "sd")
#
# dataSource <- dataSource %>% filter(branch == "Ecology" | branch == "Economics")
server
<-
function
(
input
,
output
,
session
)
{
...
...
ui - test.R
0 → 100644
View file @
b0716ebe
This diff is collapsed.
Click to expand it.
ui.R
View file @
b0716ebe
#---#################################################################---#
#### Try to apply the stepwise linear approach on the Indonesia Data ####
#---#################################################################---#
...
...
@@ -20,34 +21,20 @@
#### Load data and functions ####
#-------------------------------#
source
(
"initScenario.R"
)
source
(
"calcDistanceToPerformanceScenario.R"
)
source
(
"helper.R"
)
source
(
"solveScenario.R"
)
source
(
"helper.R"
)
source
(
"functions.R"
)
library
(
lpSolveAPI
)
library
(
tidyverse
)
library
(
readxl
)
library
(
writexl
)
library
(
shiny
)
library
(
rsconnect
)
library
(
shinyWidgets
)
library
(
stringr
)
library
(
png
)
library
(
shinyjs
)
library
(
DT
)
library
(
visNetwork
)
library
(
rintrojs
)
#-----------------#
#### Load data ####
#-----------------#
# dat <- read_excel("database.xlsx", sheet = "data", col_names = FALSE)
#
# dataSource <- datainput(dat, uncertainty = "sd")
#
# dataSource <- dataSource %>% filter(branch == "Ecology" | branch == "Economics")
ui
<-
navbarPage
(
title
=
img
(
src
=
"Logo_TUM_GOE.jpg"
,
height
=
"40px"
,
width
=
"250px"
),
id
=
"navBar"
,
theme
=
"test.css"
,
...
...
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