Skip to content

Commit

Permalink
Fixed bug in species_suitability
Browse files Browse the repository at this point in the history
  • Loading branch information
derek-corcoran-barrios committed Dec 12, 2023
1 parent de9499e commit c72cab0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/species_suitability.R
Expand Up @@ -26,7 +26,7 @@
species_suitability <- function(Rastercurrent, species_names, name = "Problem", parameter = "SpeciesSuitability", verbose = FALSE){
SuitabilityTemp <- terra::as.data.frame(Rastercurrent, cells = T)
colnames(SuitabilityTemp)[-1] <- species_names
result <- species_names |> purrr::map(~paste_suitabilities(df = SuitabilityTemp, colname = .x)) |> purrr::reduce(paste) |> paste(collapse = " ")
result <- species_names |> purrr::map(~paste_suitabilities(df = SuitabilityTemp, colname = .x)) |> purrr::reduce(c) |> paste(collapse = " ")
TempSpeciesNames <- paste(paste("param", parameter, "default 0 :=", result, ";"), collapse = " ")
if(file.exists(paste0(name, ".dat"))){
sink(paste0(name, ".dat"), append = T)
Expand Down

0 comments on commit c72cab0

Please sign in to comment.