diff --git a/NEWS.md b/NEWS.md index 35795dd2..2681db84 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # handwriter (development version) +## Minor improvements and fixes + +* Fixed a bug in `get_clusters_batch()` so it no longer returns the error message, "Unable to get cluster assignments for one or more documents," if the file all_clusters.rds exists in the output directory. + # handwriter 3.2.0 ## New features diff --git a/R/cluster_assignment.R b/R/cluster_assignment.R index b93ed3bb..2453da4b 100644 --- a/R/cluster_assignment.R +++ b/R/cluster_assignment.R @@ -183,7 +183,7 @@ get_clusters_batch <- function(template, input_dir, output_dir, writer_indices, # allow a warning to be given if a document without graphs is encountered and # this message could be removed. outfiles <- list.files(output_dir, pattern = ".rds", full.names = TRUE) - outfiles <- outfiles[which(outfiles != "all_clusters.rds")] + outfiles <- outfiles[which(basename(outfiles) != "all_clusters.rds")] if (length(outfiles) != nrow(proclist)){ warning('Unable to get cluster assignments for one or more documents.') }