diff --git a/R/g.part2.R b/R/g.part2.R index 3acff76b8..17a67db01 100644 --- a/R/g.part2.R +++ b/R/g.part2.R @@ -29,8 +29,9 @@ g.part2 = function(datadir = c(), metadatadir = c(), f0 = c(), f1 = c(), use_qwindow_as_diary = FALSE } tmp_activityDiary_file = paste0(metadatadir, "/activityDiary.RData") - if (file.exists(tmp_activityDiary_file) || - file.info(params_247[["qwindow"]])$ctime >= file.info(tmp_activityDiary_file)$ctime) { + + if (!file.exists(tmp_activityDiary_file) || (file.exists(tmp_activityDiary_file) && + file.info(params_247[["qwindow"]])$ctime >= file.info(tmp_activityDiary_file)$ctime)) { if (verbose == TRUE) cat("\nConverting activity diary...") # This will be an object with numeric qwindow values for all individuals and days params_247[["qwindow"]] = g.conv.actlog(params_247[["qwindow"]],