diff --git a/DESCRIPTION b/DESCRIPTION index 9f7ff82..e67a4e2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: gbif.range Version: 1.0 Title: A toolbox to generate species range maps based on ecoregions and a user-friendly GBIF wrapper Depends: R (>= 4.0.0) -Imports: terra, rgbif, CoordinateCleaner, sf, ClusterR, FNN, geometry, cluster, rnaturalearth, mclust, methods, utils, download.file, unzip +Imports: terra, rgbif, CoordinateCleaner, sf, ClusterR, FNN, geometry, cluster, rnaturalearth, mclust, methods, utils, utils, zip Description: This package provides a workflow to generate species range maps from scratch based on ecoregions and a user-friendly GBIF wrapper. It includes functions to create taxa range maps using ecoregions and to interact with the Global Biodiversity Information Facility (GBIF) database (retrieving species records, backbone taxonomy and IUCN conservation status). The package facilitates the process of accessing GBIF data and integrating it with ecoregion information for species distribution analysis. License: GPL (>= 3) | file LICENCE BugReports: https://github.com/8Ginette8/gbif.range/issues diff --git a/R/get_bioreg.R b/R/get_bioreg.R index 5cac1cb..e720501 100644 --- a/R/get_bioreg.R +++ b/R/get_bioreg.R @@ -100,7 +100,7 @@ get_bioreg <- function(bioreg_name = "all", save_dir = NULL) { # Download the file tryCatch({ - download.file(url, destfile, mode = "wb") + utils::download.file(url, destfile, mode = "wb") message(paste("Downloaded:", data$filename)) if (!is.null(data$description)) { message(paste("Description:", data$description)) @@ -110,7 +110,7 @@ get_bioreg <- function(bioreg_name = "all", save_dir = NULL) { }) # Unzip to folder named after filename - unzip(destfile, exdir = file.path(save_dir, data$filename)) + zip::unzip(destfile, exdir = file.path(save_dir, data$filename)) # Remove the zip file file.remove(destfile) message(paste("Unzipped:", data$filename, "\n saved to:", file.path(save_dir, data$filename),