forked from derek-corcoran-barrios/NetworkExtinction
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed graphs and degreeDistributions
- Loading branch information
derek-corcoran-barrios
committed
Mar 12, 2023
1 parent
7c64caa
commit e42d787
Showing
15 changed files
with
213 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
C:/Users/erike/Documents/[Research] Active Projects/[R Package] NetworkExtinction/NetworkExtinction_Github/README.Rmd="59A99C17" | ||
/home/au687614/Documents/NetworkExtinction/.github/workflows/pkgdown.yaml="49E1A421" | ||
/home/au687614/Documents/NetworkExtinction/README.Rmd="A12DEE6D" | ||
/home/au687614/Documents/NetworkExtinction/tests/testthat.R="FD93C6CD" | ||
/home/au687614/Documents/NetworkExtinction/tests/testthat/test-CompareExtinctions.R="ECCC3341" | ||
/home/au687614/Documents/NetworkExtinction/tests/testthat/test-DegreeDistribution.R="B9B6621D" | ||
/home/au687614/Documents/NetworkExtinction/tests/testthat/test-ExtinctionOrder.R="37B1C277" | ||
/home/au687614/Documents/NetworkExtinction/tests/testthat/test-ExtinctionPlot.R="497ADBD2" | ||
/home/au687614/Documents/NetworkExtinction/tests/testthat/test-RandomExtinctions.R="9AD4FAF8" | ||
/home/au687614/Documents/NetworkExtinction/tests/testthat/test-SimulateExtinctions.R="AB0B02E9" | ||
/home/au687614/Downloads/Degree distributonV3.R="00835093" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -588,6 +588,9 @@ ExtinctionOrder <- function(Network, Order, NetworkType = "Trophic", clust.metho | |
#' @importFrom utils setTxtProgressBar | ||
#' @importFrom utils txtProgressBar | ||
#' @importFrom patchwork wrap_plots | ||
#' @importFrom patchwork plot_annotation | ||
|
||
|
||
#' @author Derek Corcoran <[email protected]> | ||
#' @author M. Isidora Ávila-Thieme <[email protected]> | ||
#' @author Erik Kusch <[email protected]> | ||
|
@@ -658,7 +661,9 @@ RandomExtinctions <- function(Network, nsim = 10, | |
if(plot == TRUE){ | ||
g <- ggplot(sims, aes(x = NumExt, y = AccSecExt_mean)) + geom_ribbon(aes(ymin = Lower, ymax = Upper), fill = scales::muted("red")) + geom_line() + ylab("Acc. Secondary extinctions") + xlab("Primary extinctions") + theme_bw() + ggplot2::theme(axis.title.x = ggplot2::element_blank()) | ||
h <- ggplot(sims, aes(x = NumExt, y = nsim/max(nsim))) + geom_line() + theme_bw() + labs(y = "Prop", x = "Primary extinctions") | ||
I <- patchwork::wrap_plots(g, h, ncol = 1, guides = "keep", heights = c(3,1)) | ||
I <- patchwork::wrap_plots(g, h, ncol = 1, guides = "keep", heights = c(3,1)) + patchwork::plot_annotation(tag_levels = 'A') | ||
|
||
|
||
print(I) | ||
} | ||
|
||
|
@@ -703,6 +708,9 @@ RandomExtinctions <- function(Network, nsim = 10, | |
#' @importFrom ggplot2 element_blank | ||
#' @importFrom ggplot2 theme | ||
#' @importFrom patchwork wrap_plots | ||
#' @importFrom patchwork plot_annotation | ||
|
||
|
||
#' @importFrom scales muted | ||
#' @author Derek Corcoran <[email protected]> | ||
#' @author M. Isidora Ávila-Thieme <[email protected]> | ||
|
@@ -714,7 +722,7 @@ CompareExtinctions <- function(Nullmodel, Hypothesis){ | |
g <- ggplot(Nullmodel$sims, aes(x = NumExt, y = AccSecExt_mean)) + geom_ribbon(aes(ymin = Lower, ymax = Upper), fill = scales::muted("red")) + geom_line(aes(color = "blue")) + ylab("Acc. Secondary extinctions") + xlab("Primary extinctions") + theme_bw() + ggplot2::theme(axis.title.x = ggplot2::element_blank()) | ||
g <- g + geom_point(data = Hypothesis$sims, aes(y = AccSecExt), color = "black") + geom_line(data = Hypothesis$sims, aes(y = AccSecExt, color = "black")) + scale_color_manual(name = "Comparison",values =c("black", "blue"), label = c("Observed","Null hypothesis")) | ||
h <- ggplot(Nullmodel$sims, aes(x = NumExt, y = nsim/max(nsim))) + geom_line() + theme_bw() + labs(y = "Prop", x = "Primary extinctions") | ||
I <- patchwork::wrap_plots(g, h, ncol = 1, guides = "keep", heights = c(3,1)) | ||
I <- patchwork::wrap_plots(g, h, ncol = 1, guides = "keep", heights = c(3,1)) + patchwork::plot_annotation(tag_levels = 'A') | ||
I | ||
return(I) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.