Skip to content

Commit

Permalink
Fix R scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 11, 2024
1 parent 962c4bb commit 50ce078
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 7 additions & 4 deletions common-script
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,13 @@ do_shelf_ready_completeness() {
--outputDir ${OUTPUT_DIR}/ \
--trimId ${MARC_DIR}/${MASK} 2> ${LOG_DIR}/shelf-ready-completeness.log

Rscript scripts/shelf-ready/shelf-ready-histogram.R ${OUTPUT_DIR} &>> ${LOG_DIR}/shelf-ready-completeness.log

# for large files
# php scripts/shelf-ready-histogram.php ${OUTPUT_DIR} &>> ${LOG_DIR}/shelf-ready-completeness.log
# TODO: check if the file size is larger then 1G
if [[ "$TYPE_PARAMS" =~ --emptyLargeCollectors ]]; then
# for large files
php scripts/shelf-ready/shelf-ready-histogram.php ${OUTPUT_DIR} &>> ${LOG_DIR}/shelf-ready-completeness.log
else
Rscript scripts/shelf-ready/shelf-ready-histogram.R ${OUTPUT_DIR} &>> ${LOG_DIR}/shelf-ready-completeness.log
fi
}

do_bl_classification() {
Expand Down
3 changes: 3 additions & 0 deletions scripts/marc-history/marc-history-grouped.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ plot <- filtered %>%

img_dir <- sprintf('%s/img', output_dir)
if (!dir.exists(img_dir)) {
if (file.exists(img_dir) {
file.remove(img_dir)
}
dir.create(img_dir)
}

Expand Down
3 changes: 3 additions & 0 deletions scripts/pareto/frequency-range-per-types.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ create_all_pictures <- function(dir, field, file_name) {
print(paste('saving to directory ', img_dir))

if (!dir.exists(img_dir)) {
if (file.exists(img_dir) {
file.remove(img_dir)
}
print(paste('creating directory ', img_dir))
dir.create(img_dir)
}
Expand Down

0 comments on commit 50ce078

Please sign in to comment.