Skip to content

Commit

Permalink
convert logical rasters to integer
Browse files Browse the repository at this point in the history
  • Loading branch information
CeresBarros committed Aug 25, 2023
1 parent 350ea4f commit 79b9ddb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Part2_SDMs.R
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ sppDistProjMaxEnt2 <- myExperiment2$MaxEnt_rep1$sppDistProj

## we convert the raw predictions into presence absence
## using exported threshold
sppDistProjMaxEnt_PA <- myExperiment$MaxEnt_rep1$sppDistProj > myExperiment$MaxEnt_rep1$thresh
sppDistProjMaxEnt2_PA <- myExperiment2$MaxEnt_rep1$sppDistProj > myExperiment2$MaxEnt_rep1$thresh
sppDistProjMaxEnt_PA <- as.int(myExperiment$MaxEnt_rep1$sppDistProj > myExperiment$MaxEnt_rep1$thresh)
sppDistProjMaxEnt2_PA <- as.int(myExperiment2$MaxEnt_rep1$sppDistProj > myExperiment2$MaxEnt_rep1$thresh)

## rename layers from plotting
names(sppDistProjMaxEnt) <- names(sppDistProjMaxEnt2) <- c("2001", "2021-2040", "2041-2060", "2061-2080", "2081-2100")
Expand Down
4 changes: 2 additions & 2 deletions Part2_SDMs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@ sppDistProjMaxEnt2 <- myExperiment2$MaxEnt_rep1$sppDistProj
## we convert the raw predictions into presence absence
## using exported threshold
sppDistProjMaxEnt_PA <- myExperiment$MaxEnt_rep1$sppDistProj > myExperiment$MaxEnt_rep1$thresh
sppDistProjMaxEnt2_PA <- myExperiment2$MaxEnt_rep1$sppDistProj > myExperiment2$MaxEnt_rep1$thresh
sppDistProjMaxEnt_PA <- as.int(myExperiment$MaxEnt_rep1$sppDistProj > myExperiment$MaxEnt_rep1$thresh)
sppDistProjMaxEnt2_PA <- as.int(myExperiment2$MaxEnt_rep1$sppDistProj > myExperiment2$MaxEnt_rep1$thresh)
## rename layers from plotting
names(sppDistProjMaxEnt) <- names(sppDistProjMaxEnt2) <- c("2001", "2021-2040", "2041-2060", "2061-2080", "2081-2100")
Expand Down
4 changes: 2 additions & 2 deletions Part2_SDMs_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ sppDistProjMaxEnt2 <- myExperiment2$MaxEnt_rep1$sppDistProj

## we convert the raw predictions into presence absence
## using exported threshold
sppDistProjMaxEnt_PA <- myExperiment$MaxEnt_rep1$sppDistProj > myExperiment$MaxEnt_rep1$thresh
sppDistProjMaxEnt2_PA <- myExperiment2$MaxEnt_rep1$sppDistProj > myExperiment2$MaxEnt_rep1$thresh
sppDistProjMaxEnt_PA <- as.int(myExperiment$MaxEnt_rep1$sppDistProj > myExperiment$MaxEnt_rep1$thresh)
sppDistProjMaxEnt2_PA <- as.int(myExperiment2$MaxEnt_rep1$sppDistProj > myExperiment2$MaxEnt_rep1$thresh)

## rename layers from plotting
names(sppDistProjMaxEnt) <- names(sppDistProjMaxEnt2) <- c("2001", "2021-2040", "2041-2060", "2061-2080", "2081-2100")
Expand Down

0 comments on commit 79b9ddb

Please sign in to comment.