Skip to content

Commit

Permalink
Some small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
simularis committed Apr 13, 2021
1 parent 01d686d commit f03f845
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
12 changes: 11 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@ save_session <- function(save_dir,project_name,results){
detail = 'This may take a while...',
value = 0,
{
results_list <- reactiveValuesToList(results)
path_save <- paste(save_dir,.Platform$file.sep,project_name, ".rds",sep="")
cat(glue('Preparing to save session to "{path_save}" ...'),fill=T)
#cat("Isolating and listing reactive values ...",fill=T)
#results_list <- isolate(reactiveValuesToList(results))
cat("Listing reactive values ... ")
results_list <- reactiveValuesToList(results)
cat("in-memory size of data ...")
srl <- object.size(results_list)
print(srl, units="KiB") # IEC unit KiB as displayed by windows explorer
saveRDS(results_list, file = path_save)
cat("Done saving. Size of the file: ")
sf <- structure(file.size(path_save),class="object_size")
print(sf, units="KiB")
})
})
}
Expand Down
7 changes: 4 additions & 3 deletions demo/understand_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ library(glue)
#rds_file <- "C:/RMV2.0 Workshop/uncertain_savings4/Project_02.16.rds"
#rds_file <- "C:/RMV2.0 Workshop/uncertain_screening1/Project_02.17.rds"
#rds_file <- "C:/RMV2.0 Workshop/uncertain_screening2/Project_02.18.rds"
rds_file <- "C:/RMV2.0 Workshop/uncertain_savings5/Project_02.18.rds"
#rds_file <- "C:/RMV2.0 Workshop/uncertain_savings5/Project_02.18.rds"
rds_file <- "C:/RMV2.0 Workshop/something/Project_02.19.rds"
Project <- readRDS(rds_file)
cat("Your project has the following models.",fill=T)
print(names(Project$model_obj_list$models_list))

# Uncomment to have a graphical View appear and show you everything from the project file.
#View(Project)
View(Project)

# These will just print text info summary of the project file structure.
cat("Project file had the following structure:",fill=T)
print(names(Project))
# Typical for screening analysis
# [1] "files_path_sc" "fahrenheit" "Data_pre_summary_0" "Data_pre_summary" "files_names" "model_obj_list"
# [7] "p_name_sc" "Data_pre" "pre_dir_sc" "files_names_mod" "Model"
# Typical for screening analysis
# Typical for savings analysis
# [1] "Data_pre_summary_0" "load" "files_names" "post_names_sav" "pre_names_sav"
# [6] "Data_pre" "files_names_mod" "p_name_sav" "post_path_sav" "Data_pre_summary"
# [11] "fahrenheit" "post_dir_sav" "model_obj_list" "pre_path_sav" "Data_post"
Expand Down
1 change: 1 addition & 0 deletions inst/shiny/guiApp/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ library(shinyjs)
library(shinyFiles)
library(DT)
library(RMV2.0)
library(glue)

source('js.R')

Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/guiApp/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ shinyServer(function(input, output, session) {

# set the project name
p_name_sc <- renderText({input$p_name_sc})
screen_out$p_name_sc <- p_name_sc
observe({screen_out$p_name_sc <- p_name_sc()})

observe({change_box("save_dir_sc_box", !(is.integer(input$save_dir_sc)))})

Expand Down

0 comments on commit f03f845

Please sign in to comment.