Skip to content

Commit

Permalink
cambios en RLI
Browse files Browse the repository at this point in the history
Se realizaron cambios para ejecutar el pipeline de RLI
  • Loading branch information
biorey committed Sep 6, 2024
1 parent e8b854f commit 4ceb657
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ print(token)

UICN_spList<- data.table::fread(input$species_data) %>% as.data.frame()

IUCN_historyAssesment_data <- pbapply::pblapply(UICN_spList[,input$sp_col] , function(x) {
IUCN_historyAssesment_data <- pbapply::pblapply(UICN_spList[,input$sp_col][1:10], function(x) {
tryCatch({
rredlist::rl_history(name = x, key = token)$result %>%
dplyr::mutate(scientific_name= x)
Expand Down
5 changes: 2 additions & 3 deletions scripts/IUCN_redlist_spList/IUCN_redlist_spList.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ input <- rjson::fromJSON(file=file.path(outputFolder, "input.json")) # Load inpu
input<- lapply(input, function(y) lapply(y, function(x) { if (!is.null(x) && length(x) > 0 && grepl("/", x) && !grepl("http://", x) ) { sub("/output/.*", "/output", outputFolder) %>% dirname() %>% file.path(x) %>% {gsub("//+", "/", .)} } else{x} }) %>% unlist())

# Script body ####


token<- "f33e69dfa9b06a6495aca3b049606f6e08ceb37083ff88a9c7c9dfbcd56a9121"
print(Sys.getenv("SCRIPT_LOCATION"))
token<- Sys.getenv("IUCN_TOKEN")
print(token)

## Load sp country ####
Expand Down
4 changes: 3 additions & 1 deletion scripts/RedlListindex/RedlListindex.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

# Install necessary libraries - packages
packagesPrev<- installed.packages()[,"Package"] # Check and get a list of installed packages in this machine and R version
packagesNeed<- c("magrittr", "data.table", "reshape2", "dplyr", "plyr", "ggplot2", "tibble", "pbapply", "rredlist", "plyr", "red", "gdistance", "BAT", "ape", "geometry", "magic", "hypervolume", "ks", "mclust", "mvtnorm","pracma","fastcluster", "pdist","palmerpenguins","caret","recipes", "timeDate", "gower", "hardhat","ipred", "prodlim", "lava","future.apply", "future", "globals", "listenv", "parallelly", "ModelMetrics","pROC", "nls2", "proto", "vegan","permute","phytools", "combinat", "clusterGeneration", "DEoptim", "expm", "optimParallel", "phangorn", "fastmatch", "scatterplot3d", "predicts") # Define the list of required packages to run the script
# Install necessary libraries - packages
packagesPrev<- installed.packages()[,"Package"] # Check and get a list of installed packages in this machine and R version
packagesNeed<- c("magrittr", "data.table", "reshape2", "dplyr", "plyr", "ggplot2", "tibble", "pbapply", "rredlist", "plyr", "red", "gdistance", "BAT", "ape", "geometry", "magic", "hypervolume", "ks", "mclust", "mvtnorm","pracma","fastcluster", "pdist","palmerpenguins","caret","recipes", "timeDate", "gower", "hardhat","ipred", "prodlim", "lava","future.apply", "future", "globals", "listenv", "parallelly", "ModelMetrics","pROC", "nls2", "proto", "vegan","permute","phytools", "combinat", "clusterGeneration", "DEoptim", "expm", "optimParallel", "phangorn", "fastmatch", "scatterplot3d", "predicts","coda", "mnormt", "numDeriv", "quadprog") # Define the list of required packages to run the script
new.packages <- packagesNeed[!(packagesNeed %in% packagesPrev)]; if(length(new.packages)) {install.packages(new.packages, binary=T, force=T, dependencies = F, repos= "https://packagemanager.posit.co/cran/__linux__/jammy/latest")} # Check and install required packages that are not previously installed

# Load libraries
Expand Down

0 comments on commit 4ceb657

Please sign in to comment.