Browse Source

Report Added

main
Asitav Sen 3 years ago
parent
commit
00b045ee8e
  1. 4
      .Rproj.user/178A6739/sources/prop/A1AE5A83
  2. 8
      .Rproj.user/178A6739/sources/session-99529da2/FE6BB309
  3. 9
      .Rproj.user/178A6739/sources/session-99529da2/FE6BB309-contents
  4. 9
      app.R

4
.Rproj.user/178A6739/sources/prop/A1AE5A83

@ -1,6 +1,6 @@
{ {
"source_window_id": "", "source_window_id": "",
"Source": "Source", "Source": "Source",
"cursorPosition": "23,0", "cursorPosition": "451,32",
"scrollLine": "16" "scrollLine": "442"
} }

8
.Rproj.user/178A6739/sources/session-99529da2/FE6BB309

@ -12,15 +12,15 @@
"properties": { "properties": {
"source_window_id": "", "source_window_id": "",
"Source": "Source", "Source": "Source",
"cursorPosition": "23,0", "cursorPosition": "451,32",
"scrollLine": "16" "scrollLine": "442"
}, },
"folds": "", "folds": "",
"lastKnownWriteTime": 1686050157, "lastKnownWriteTime": 1686050585,
"encoding": "UTF-8", "encoding": "UTF-8",
"collab_server": "", "collab_server": "",
"source_window": "", "source_window": "",
"last_content_update": 1686050157531, "last_content_update": 1686050585975,
"read_only": false, "read_only": false,
"read_only_alternatives": [] "read_only_alternatives": []
} }

9
.Rproj.user/178A6739/sources/session-99529da2/FE6BB309-contents

@ -140,7 +140,7 @@ server <- function(input, output) {
databaseID <- "IFS" databaseID <- "IFS"
startdate = min(new.data()$report_date) startdate = min(new.data()$report_date)
enddate = max(new.data()$report_date) enddate = max(new.data()$report_date)
country = countries[countries$Country == input$country, ]$Alpha.2.code country = countries[countries$Country == input$country,]$Alpha.2.code
withProgress(message = "Extracting data from IMF", withProgress(message = "Extracting data from IMF",
detail = "Hope their server is up!", detail = "Hope their server is up!",
value = 0, value = 0,
@ -210,7 +210,7 @@ server <- function(input, output) {
# removing rows with no macroeconomic data # removing rows with no macroeconomic data
dataset_eco <- dataset_eco <-
dataset_with_eco[!is.na(dataset_with_eco$gdp_lag) & dataset_with_eco[!is.na(dataset_with_eco$gdp_lag) &
!is.na(dataset_with_eco$prices_lag),] !is.na(dataset_with_eco$prices_lag), ]
setProgress(value = 2, message = "working..") setProgress(value = 2, message = "working..")
}) })
@ -325,8 +325,7 @@ server <- function(input, output) {
# Model Selection. Using functions. In production these are to be converted to APIs # Model Selection. Using functions. In production these are to be converted to APIs
selected_model <- reactive({ selected_model <- reactive({
req(input$start_model_selection, req(input$start_model_selection,!is.null(dataset_with_eco()))
!is.null(dataset_with_eco()))
model_sel(dff = dataset_with_eco()) model_sel(dff = dataset_with_eco())
}) })
@ -646,7 +645,7 @@ server <- function(input, output) {
}) })
output$cumprob <- renderText({ output$cumprob <- renderText({
req(!is.null(input$sim_res_sel),!is.null(simresdata())) req(!is.null(input$sim_res_sel), !is.null(simresdata()))
hist.pro <- simresdata() hist.pro <- simresdata()
pro_dens <- data.frame(hist.pro$x, hist.pro$y) pro_dens <- data.frame(hist.pro$x, hist.pro$y)
res <- brushedPoints(pro_dens, input$sim_res_sel) res <- brushedPoints(pro_dens, input$sim_res_sel)

9
app.R

@ -140,7 +140,7 @@ server <- function(input, output) {
databaseID <- "IFS" databaseID <- "IFS"
startdate = min(new.data()$report_date) startdate = min(new.data()$report_date)
enddate = max(new.data()$report_date) enddate = max(new.data()$report_date)
country = countries[countries$Country == input$country, ]$Alpha.2.code country = countries[countries$Country == input$country,]$Alpha.2.code
withProgress(message = "Extracting data from IMF", withProgress(message = "Extracting data from IMF",
detail = "Hope their server is up!", detail = "Hope their server is up!",
value = 0, value = 0,
@ -210,7 +210,7 @@ server <- function(input, output) {
# removing rows with no macroeconomic data # removing rows with no macroeconomic data
dataset_eco <- dataset_eco <-
dataset_with_eco[!is.na(dataset_with_eco$gdp_lag) & dataset_with_eco[!is.na(dataset_with_eco$gdp_lag) &
!is.na(dataset_with_eco$prices_lag),] !is.na(dataset_with_eco$prices_lag), ]
setProgress(value = 2, message = "working..") setProgress(value = 2, message = "working..")
}) })
@ -325,8 +325,7 @@ server <- function(input, output) {
# Model Selection. Using functions. In production these are to be converted to APIs # Model Selection. Using functions. In production these are to be converted to APIs
selected_model <- reactive({ selected_model <- reactive({
req(input$start_model_selection, req(input$start_model_selection,!is.null(dataset_with_eco()))
!is.null(dataset_with_eco()))
model_sel(dff = dataset_with_eco()) model_sel(dff = dataset_with_eco())
}) })
@ -646,7 +645,7 @@ server <- function(input, output) {
}) })
output$cumprob <- renderText({ output$cumprob <- renderText({
req(!is.null(input$sim_res_sel),!is.null(simresdata())) req(!is.null(input$sim_res_sel), !is.null(simresdata()))
hist.pro <- simresdata() hist.pro <- simresdata()
pro_dens <- data.frame(hist.pro$x, hist.pro$y) pro_dens <- data.frame(hist.pro$x, hist.pro$y)
res <- brushedPoints(pro_dens, input$sim_res_sel) res <- brushedPoints(pro_dens, input$sim_res_sel)

Loading…
Cancel
Save