From 281fbe55af7d8639e2377ee4c5afb4da6b973be6 Mon Sep 17 00:00:00 2001 From: Will Cornwell Date: Wed, 31 Jul 2024 17:52:15 +1000 Subject: [PATCH] missed two checking spots --- R/create_species_state_origin_matrix.R | 1 + R/state_diversity_counts.R | 6 ++++++ R/update_taxonomy.R | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/R/create_species_state_origin_matrix.R b/R/create_species_state_origin_matrix.R index a3d82d11..6cee1773 100644 --- a/R/create_species_state_origin_matrix.R +++ b/R/create_species_state_origin_matrix.R @@ -27,6 +27,7 @@ #' #' create_species_state_origin_matrix <- function(resources = load_taxonomic_resources()) { + if(is.null(resources)){ message("Not finding taxonomic resources; check internet connection?") return(NULL) diff --git a/R/state_diversity_counts.R b/R/state_diversity_counts.R index ad0ce302..703dfd14 100644 --- a/R/state_diversity_counts.R +++ b/R/state_diversity_counts.R @@ -28,6 +28,12 @@ #' \donttest{state_diversity_counts(state = "NSW")} state_diversity_counts <- function(state, resources = load_taxonomic_resources()) { + + if(is.null(resources)){ + message("Not finding taxonomic resources; check internet connection?") + return(NULL) + } + valid_inputs <- c( "NSW", "NT", diff --git a/R/update_taxonomy.R b/R/update_taxonomy.R index ebc0b053..5df8993f 100644 --- a/R/update_taxonomy.R +++ b/R/update_taxonomy.R @@ -117,6 +117,11 @@ update_taxonomy <- function(aligned_data, output = NULL, resources = load_taxonomic_resources()) { + if(is.null(resources)){ + message("Not finding taxonomic resources; check internet connection?") + return(NULL) + } + aligned_data <- aligned_data %>% dplyr::select(original_name, aligned_name, taxon_rank, taxonomic_dataset, aligned_reason) %>%