-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
Hi Peter,
I was unable to reproduce the error I got in the first run, but had a few more crashes.
It seems to be related to memory usage indeed, as memory use by RStudio keeps on increasing while the loop runs (see screenshots below).
Adding gc() within the loop seemed to help, athough the task manager still shows memory use increasing.
Here is the code run on the raw data (in blanke-nas-1, under Public/Simon/RAW_Data_Cut):
library(forceR)
library(magrittr)
library(dplyr)
library(stringr)
library(purrr)
library(ggplot2)
library(readr)
raw_fold <- "../RAW_Data_Cut"
files <- file.path(raw_fold, list.files(raw_fold, pattern = ".dat"))
for (i in 1:length(files)) {
convert_measurement(file = files[i], path.data = "./converted_files/")
gc(verbose = F)
} #Loop crashes R sometimes
convert_fold <- "./converted_files"
con_files <- file.path(convert_fold, list.files(convert_fold))
ampdriftcorr_folder <- "./ampdriftcorr"
for(i in 1:length(con_files)){
filename <- con_files[i]
print(filename)
print(i)
amp_drift_corr(filename = filename,
tau = 9400,
res.reduction = 10,
plot.to.screen = FALSE,
write.data = TRUE,
write.PDFs = TRUE,
write.logs = TRUE,
output.folder = ampdriftcorr_folder,
show.progress = FALSE)
gc()
print("***********")
} #Loop here also crashes
Metadata
Metadata
Assignees
Labels
No labels


