petteriTeikari / R-PLR

Once separate repos combined to one making it easier in the end
1 stars 0 forks source link

problem creating folders in TEST OUT #4

Closed ray-najjar closed 6 years ago

ray-najjar commented 6 years ago

This comes out after calling import.and.install.libraries(paths)

_Checking the LIBRARIESCreating the directory for DATA Recon outputCreating the directory for DATA Imputed outputCreating the directory for DATA Trimmed outputCreating the directory for DATA Recon EMD output

Warning messages:
1: In dir.create(data_path_out, showWarnings = TRUE, recursive = FALSE,  :
  cannot create dir 'C:\Users\Ray-Najjar\Desktop\GitPLR\R-PLR\..\TEST_OUT\outlier_free\outlier_free_corrected\..\recon', reason 'No such file or directory'
2: In dir.create(data_resampled_path_out, showWarnings = TRUE, recursive = FALSE,  :
  cannot create dir 'C:\Users\Ray-Najjar\Desktop\GitPLR\R-PLR\..\TEST_OUT\outlier_free\outlier_free_corrected\..\recon_resampled', reason 'No such file or directory'
3: In dir.create(data_trimmed_path_out, showWarnings = TRUE, recursive = FALSE,  :
  cannot create dir 'C:\Users\Ray-Najjar\Desktop\GitPLR\R-PLR\..\TEST_OUT\outlier_free\outlier_free_corrected\..\recon_trimmed', reason 'No such file or directory'
4: In dir.create(data_temp_path_out, showWarnings = TRUE, recursive = FALSE,  :
  cannot create dir 'C:\Users\Ray-Najjar\Desktop\GitPLR\R-PLR\..\TEST_OUT\outlier_free\outlier_free_corrected\..\recon_EMD', reason 'No such file or directory'_

[Petteri edit], see @ray-najjar the Markdown Cheatsheet to adding the triple apostrophes with the language pasted

petteriTeikari commented 6 years ago

The import.and.install.libraries(paths)install calls the function init_reconstructionthat is the actual source of the error message.

But the actual problem is in the path creation (init.paths.and.functions = function(paths)), and it tried to give two non-created nested subfolders.

outlier_free was not created at first place and we tried to create recon et al. one folder back from outlier_free_corrected which did not exist either.

Created the OUTPUT folder automatically now with

if (dir.exists(paths[['data_out']][['base']]) == FALSE) {
    dir.create(paths[['data_out']][['base']], showWarnings = TRUE, recursive = FALSE, mode = "0777")
    cat('Creating the directory for DATA OUTPUT\n')
  }

And then also the outlier_free with:

  # Create outlier_free
  if (dir.exists(paths[['data_out']][['artifacts']]) == FALSE) {
    dir.create(paths[['data_out']][['artifacts']], showWarnings = TRUE, recursive = FALSE, mode = "0777")
    cat('Creating the directory for DATA OUTLIER_FREE\n')
  }

Fix in commit: https://github.com/petteriTeikari/R-PLR/commit/b85f6d1f3d5774884e81e093d1086eed88011025