petteriTeikari/R-PLR

Imputation of missing values

Closed this issue · 1 comments

"Recon" Folders are being created outside the TEST_OUT folder.
When running Server to inspect manually :

warning('Petteri: Inspect the imputation now manually, \n
          or change the path from next block if you do not want to do it \n
          Eyeball the details from the GITHUB WIKI if this does not make sense to you')

Warning in file(file, "rt") :
  cannot open file 'C:/Users/User/Desktop/RPLR/TEST_OUT/imputation_final/NA': No such file or directory
Warning: Error in file: cannot open the connection
  50: file
  49: read.table
  48: read.csv
  47: server [C:\Users\User\Desktop\RPLR\R-PLR\Apps_Shiny\inspect_outliers/server.R#105]
Error in file(file, "rt") : cannot open the connection

This came from a call of batch.AnalyzeAndReImpute() that called init_reconstruction.R that was used by many functions and did not need to create the folders on each call to it.

Added the create_dir flag to avoid this from happening

if (identical(from_where_call, 'analyzReimpute')) {
    data_path = file.path(data_path, '..', fsep = .Platform$file.sep)
    cat('\nChanging base path for data outputs to:', data_path, '\n\n')
    create_dirs = FALSE
  }