From e31bfbb985265ff4820d7d64bbd7d2f85d47d02c Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 30 Oct 2024 14:30:03 -0400 Subject: [PATCH] Pair programming URL accommodation adds --- scripts/url-check.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/url-check.R b/scripts/url-check.R index 113c1a8..b90e284 100644 --- a/scripts/url-check.R +++ b/scripts/url-check.R @@ -134,7 +134,10 @@ get_urls <- function(file) { urls <- unlist(url_list) # Remove trailing characters - urls <- gsub("\\'\\:$|\\'|\\:$|\\.$", "", urls) + urls <- gsub("\\'\\:$|\\'|\\:$|\\.$|\\)$|\\,$", "", urls) + + # Remove URLs that are in the ignore + if( ignore_urls[1] != "") urls <- grep(paste0(ignore_urls, collapse = "|"), urls, invert = TRUE, value = TRUE) if (length(urls) > 0 ){ # Remove trailing characters @@ -150,8 +153,7 @@ get_urls <- function(file) { all_urls <- lapply(files, get_urls) # Write the file -all_urls_df <- dplyr::bind_rows(all_urls) %>% - dplyr::filter(!(urls %in% ignore_urls)) +all_urls_df <- dplyr::bind_rows(all_urls) if (nrow(all_urls_df) > 0) { all_urls_df <- all_urls_df %>%