From 2132f53d706d53602f256bdb353cf353b7ad7182 Mon Sep 17 00:00:00 2001 From: Mohamed Yusuf Date: Fri, 24 May 2024 00:56:17 +0100 Subject: [PATCH] Update function so it doesnt stop too early during saving of cache --- R/prep_geonames.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/prep_geonames.R b/R/prep_geonames.R index 0fe9e72..019313c 100644 --- a/R/prep_geonames.R +++ b/R/prep_geonames.R @@ -994,7 +994,7 @@ prep_geonames <- function(target_df, lookup_df = NULL, # Step 4: clean up the cache file and save ----------------------------------- - if (length(as.data.frame(cleaned_dfs)) > 0) { + if (length(cleaned_dfs) > 0 && any(sapply(cleaned_dfs, nrow) > 0)) { # clean up the cache df suppressWarnings( cleaned_cache_joined <- dplyr::bind_rows(cleaned_dfs) |>