Skip to content

Commit

Permalink
Avoid using importFrom
Browse files Browse the repository at this point in the history
See #86
  • Loading branch information
damianooldoni committed Jun 8, 2022
1 parent 1ef01f0 commit ad98871
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
4 changes: 0 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ importFrom(dplyr,case_when)
importFrom(dplyr,count)
importFrom(dplyr,desc)
importFrom(dplyr,distinct)
importFrom(dplyr,distinct_)
importFrom(dplyr,do)
importFrom(dplyr,enquo)
importFrom(dplyr,filter)
Expand All @@ -47,7 +46,6 @@ importFrom(dplyr,if_else)
importFrom(dplyr,inner_join)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_all)
importFrom(dplyr,mutate_if)
importFrom(dplyr,n)
importFrom(dplyr,n_distinct)
Expand Down Expand Up @@ -103,9 +101,7 @@ importFrom(mgcv,nb)
importFrom(mgcv,summary.gam)
importFrom(plotly,ggplotly)
importFrom(plotly,layout)
importFrom(purrr,cross_df)
importFrom(purrr,list_along)
importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,map2_chr)
importFrom(purrr,map_chr)
Expand Down
13 changes: 5 additions & 8 deletions R/gbif_has_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
#' occurrenceStatus) and establishmentMeans.
#' @return a logical, TRUE or FALSE.
#' @export
#' @importFrom assertthat assert_that
#' @importFrom rgbif name_usage
#' @importFrom dplyr select %>% distinct_ mutate_all
#' @importFrom purrr map cross_df
#' @importFrom dplyr %>%
#' @examples
#' # numeric taxonKey, atomic parameters
#' gbif_has_distribution(145953242,
Expand Down Expand Up @@ -115,13 +112,13 @@ gbif_has_distribution <- function(taxon_key, ...) {
return(FALSE)
} else {
# Avoid mismatch due to any upper/lowercase difference
user_properties <- map(user_properties, ~ toupper(.))
# Check whether at least
user_properties <- purrr::map(user_properties, ~ toupper(.))
# Check whether at least one property defined by user is present
has_distr <- dplyr::intersect(
user_properties %>%
cross_df(),
purrr::cross_df(),
distr_properties %>%
select(names(user_properties)) %>%
dplyr::select(names(user_properties)) %>%
dplyr::distinct() %>%
dplyr::mutate(dplyr::across(.cols = everything(), toupper))
) %>%
Expand Down

0 comments on commit ad98871

Please sign in to comment.