Skip to content

Commit

Permalink
Remove importing of dplyr, stringr, remove tibble
Browse files Browse the repository at this point in the history
- add explcit namespace to calls of relevant functions
  • Loading branch information
dfalster committed May 2, 2024
1 parent d7cd88e commit fa14c4e
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 99 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Imports:
readr,
purrr,
forcats,
tibble,
dplyr,
stringr,
stringi,
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ export(state_diversity_counts)
export(strip_names)
export(strip_names_extra)
export(update_taxonomy)
import(dplyr)
import(stringr)
8 changes: 4 additions & 4 deletions R/align_taxa.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ align_taxa <- function(original_name,
}
else {
taxa_raw <-
tibble::tibble(
dplyr::tibble(
original_name = character(0L),
cleaned_name = character(0L),
aligned_name = character(0L),
Expand All @@ -124,7 +124,7 @@ align_taxa <- function(original_name,
taxa[["tocheck"]] <-
dplyr::bind_rows(
taxa_raw,
tibble::tibble(
dplyr::tibble(
original_name =
# only include new names
subset(original_name,
Expand Down Expand Up @@ -198,8 +198,8 @@ align_taxa <- function(original_name,
if (!all(taxa$tocheck$checked)) {

perfect_matches <- taxa$tocheck %>%
filter(original_name %in% resources$`APC list (accepted)`$canonical_name) %>%
distinct(original_name) %>%
dplyr::filter(original_name %in% resources$`APC list (accepted)`$canonical_name) %>%
dplyr::distinct(original_name) %>%
nrow()

if(!quiet)
Expand Down
10 changes: 4 additions & 6 deletions R/load_taxonomic_resources.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
#' @examples
#' \donttest{load_taxonomic_resources(stable_or_current_data="stable",version="0.0.2.9000")}
#'
#' @import dplyr
#'

load_taxonomic_resources <-
function(stable_or_current_data = "stable",
Expand Down Expand Up @@ -53,7 +51,7 @@ load_taxonomic_resources <-
zzz <- "zzzz zzzz"

taxonomic_resources$APC <- taxonomic_resources$APC %>%
rename(
dplyr::rename(
taxon_ID = .data$taxonID,
taxon_rank = .data$taxonRank,
name_type = .data$nameType,
Expand All @@ -72,13 +70,13 @@ load_taxonomic_resources <-
nomenclatural_code = .data$nomenclaturalCode,
dataset_name = .data$datasetName
) %>%
mutate(
dplyr::mutate(
genus = extract_genus(canonical_name),
taxon_rank = standardise_taxon_rank(taxon_rank)
)

taxonomic_resources$APNI <- taxonomic_resources$APNI %>%
rename(
dplyr::rename(
name_type = .data$nameType,
taxonomic_status = .data$taxonomicStatus,
taxon_rank = .data$taxonRank,
Expand All @@ -91,7 +89,7 @@ load_taxonomic_resources <-
dataset_name = .data$datasetName,
name_element = .data$nameElement
) %>%
mutate(
dplyr::mutate(
genus = extract_genus(canonical_name),
taxon_rank = standardise_taxon_rank(taxon_rank)
)
Expand Down
Loading

0 comments on commit fa14c4e

Please sign in to comment.