diff --git a/.gitignore b/.gitignore index 23f08ed..982fa22 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ inst/doc .RData .RData .Rproj.user/shared/notebooks/paths +docs diff --git a/_pkgdown.yml b/_pkgdown.yml index 6ef5f5a..d71acfb 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1 +1,4 @@ -destination: docs +url: ~ +template: + bootstrap: 5 + diff --git a/docs/404.html b/docs/404.html index ae94e31..fc3232f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,163 +1,93 @@ - - - - + + + + - - + Page not found (404) • NetworkExtinction - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - -
-
-
+ +
+ + +
-
- - - - +
- -
- +
+
+ - - diff --git a/docs/articles/index.html b/docs/articles/index.html index dfba567..ba3de31 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,162 +1,68 @@ - - - - - - - -Articles • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Articles • NetworkExtinction + Skip to contents + +
-
- -
+
How to use the NetworkExtinction Package
+
+
+
-
+ - - - + diff --git a/docs/authors.html b/docs/authors.html index 2ba15af..1942173 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,178 +1,107 @@ - - - - - - - -Authors • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Authors and Citation • NetworkExtinction + Skip to contents + +
-
- - -
- +
+

Authors

+ +
  • +

    Derek Corcoran. Author, maintainer. +

    +
  • +
  • +

    M. Isidora Ávila-Thieme. Author. +

    +
  • +
  • +

    Fernanda S. Valdovinos. Author. +

    +
  • +
  • +

    Sergio A. Navarrete. Author. +

    +
  • +
  • +

    Pablo A. Marquet. Author. +

    +
  • +
  • +

    Erik Kusch. Author. +

    +
  • +
+ +
+

Citation

+

+ +

Corcoran D, Ávila-Thieme M, Valdovinos F, Navarrete S, Marquet P, Kusch E (2022). +NetworkExtinction: Extinction Simulation in Food Webs. +R package version 1.0.0, https://derek-corcoran-barrios.github.io/NetworkExtinction/. +

+
@Manual{,
+  title = {NetworkExtinction: Extinction Simulation in Food Webs},
+  author = {Derek Corcoran and M. Isidora Ávila-Thieme and Fernanda S. Valdovinos and Sergio A. Navarrete and Pablo A. Marquet and Erik Kusch},
+  year = {2022},
+  note = {R package version 1.0.0},
+  url = {https://derek-corcoran-barrios.github.io/NetworkExtinction/},
+}
+
+
-
+ - - - + diff --git a/docs/index.html b/docs/index.html index ab87a82..3746c0d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,9 @@ - + + Extinction Simulation in Food Webs • NetworkExtinction @@ -12,12 +14,11 @@ - - - + + + - - + @@ -26,107 +27,225 @@ - -
-
-
- -
-
-
-

-pkgdown +
+

pkgdown

- -

The goal of NetworkExtinction is to Simulate the extinction of species in the food web and to analyze its cascading effects, as described in Dunne et al. (2002)

-
-

-Installation

-

You can install the released version of NetworkExtinction from CRAN with:

+

The goal of NetworkExtinction is to Simulate the extinction of species in the food web and to analyze its cascading effects, as described in Dunne et al. (2002)

+
+

Installation +

+

You can install the released version of NetworkExtinction from CRAN with:

-install.packages("NetworkExtinction")
-

And the development version from GitHub with:

+install.packages("NetworkExtinction")
+

And the development version from GitHub with:

-# install.packages("devtools")
-devtools::install_github("derek-corcoran-barrios/NetworkExtinction")
-
-
-

-Extinctions functions

-
-

-Extinctions from most to less conected species in the network

-

The Mostconnected function sorts the species from the most connected node to the least connected node, using total degree. Then, it removes the most connected node in the network, simulating its extinction, and recalculates the topological indexes of the network and counts how many species have indegree 0 (secondary extinction), not considering primary producers. Then, it removes the nodes that were secondarily extinct in the previous step and recalculates which node is the new most connected species. This step is repeated until the number of links in the network is zero (Sole and Montoya 2001; Dunne, Williams, and Martinez 2002; Dunne and Williams 2009). In this new version it also calculates the Predatory release.

+# install.packages("devtools") +devtools::install_github("derek-corcoran-barrios/NetworkExtinction")
+
+
+

Extinctions functions +

+
+

Extinctions from most to less conected species in the network +

+

The Mostconnected() function sorts the species from the most connected node to the least connected node, using total degree. Then, it removes the most connected node in the network, simulating its extinction, and recalculates the topological indexes of the network and counts how many species have indegree 0 (secondary extinction), not considering primary producers. Then, it removes the nodes that were secondarily extinct in the previous step and recalculates which node is the new most connected species. This step is repeated until the number of links in the network is zero (Sole and Montoya 2001; Dunne, Williams, and Martinez 2002; Dunne and Williams 2009).

-library(NetworkExtinction)
-data("net")
-SimulateExtinctions(Network = net, Method = "Mostconnected")
- +library(NetworkExtinction) +data("net") +SimulateExtinctions(Network = net, Method = "Mostconnected")
+

The result of this function is a list which contains the dataframe shown in table 1. The first column called Spp indicates the order in which the species were removed simulating an extinction. The column Secondary_extinctions represents the numbers of species that become extinct given that they do not have any food items left in the food web, while the AccSecondaryExtinction column represents the accumulated secondary extinctions. (To plot the results, see function ExtinctionPlot().)

+
+data("More_Connected")
+history <- SimulateExtinctions(Network = net, Method = "Mostconnected")
+ExtinctionPlot(History = history[[1]], Variable = "AccSecExt")
+

Figure 3. The graph shows the number of accumulated secondary extinctions that occur when removing species from the most to the least connected species

+

In addition, the list returned by SimulateExtinctions() also contains the final Network that remains after all primary extinctions have been finished:

+
+
+

Extinctions using a customized order +

+

The ExtinctionOrder() function takes a network and extinguishes nodes using a customized order. Then, it calculates the topological network indexes and the secondary extinctions. In our toy network, nodes 1-4 are primary producers while nodes 9 and 10 represent apex predators. Let’s see what happens when we sequentially remove all but the apex predators:

+
+data("net")
+SimulateExtinctions(Network = net, Order = 1:8, Method = "Ordered")
+

Already at the removal of node 5, we loose support for all other species in the network.

+

Figure 4. The graph shows the number of accumulated secondary extinctions that occur when removing species in a custom order.

+

The results of this function are a dataframe with the topological indexes of the network calculated from each extinction step (Table 2), and a plot that shows the number of accumulated secondary extinctions that occurred with each removed node (Figure 4).

+
+
+

Random extinction +

+

The RandomExtinctions() function generates n random extinction orders, determined by the argument nsim. The first result of this function is a dataframe (table 3). With the SimNum argument, you can control how many of the nodes in the network should be simulated to go extinct for each random extinction order. Here, we choose the same number as we set for our custom order example above.

+

The column NumExt represents the number of species removed, AccSecondaryExtinction is the average number of secondary extinctions for each species removed, and SdAccSecondaryExtinction is its standard deviation. The second result is a graph (figure 5), where the x axis is the number of species removed and the y axis is the number of accumulated secondary extinctions. The solid line is the average number of secondary extinctions for every simulated primary extinction, and the red area represents the mean ± the standard deviation of the simulations.

+
+data(net)
+set.seed(707)
+RandomExtinctions(Network= net, nsim= 100, SimNum = 8)
+

Figure 5. The resulting graph of the RandomExtinctions function

+
+
+

Comparison of Null hypothesis with other extinction histories +

+

The RandomExtinctons() function generates a null hypothesis for us to compare it with either an extinction history generated by the ExtinctionOrder() function or the Mostconnected() function. In order to compare the expected extinctions developed by our null hypothesis with the observed extinction history, we developed the CompareExtinctions() function. The way to use this last function is to first create the extinction history and the null hypothesis, and then the CompareExtinctions() function to compare both extinction histories.

+
+data("net")
+Comparison <- CompareExtinctions(Nullmodel = Test, Hypothesis = Order)
+

The result will be a graph (Figue 6) with a dashed line showing the observed extinction history and a solid line showing the expected value of secondary extinctions randomly generated.

+

Figure 6. The resulting graph of the CompareExtinctions function, where the dashed line shows the observed extinction history, and a solid line shows the expected value of secondary extinctions originated at random

+
+
+
+

Plotting the extinction histories of a network +

+

The ExtinctionPlot() function takes a NetworkTopology class object and plots the index of interest after every extinction. By default, the function plots the number of accumulated secondary extinctions after every primary extinction (Figure 7), but any of the indexes can be plotted with the function by changing the Variable argument (Figure 8).

+
+data(net)
+ExtinctionPlot(History = Order[[1]])
+

Figure 7. Example of the use of the ExtinctionPlot function showing the accumulated secondary extinctions against number of extinctions

+
+ExtinctionPlot(History = Order[[1]], Variable = "Link_density")
+

Figure 8. Another example of the use of the ExtinctionPlot function showing the number of links per species against number of extinctions

+
+
+

Degree distribution function +

+

The DegreeDistribution() function calculates the cumulative distribution of the number of links that each species in the food network has (Estrada 2007). Then, the observed distribution is fitted to the exponential, and power law models.

+

The results of this function are shown in figure 9 and table 4. The graph shows the observed degree distribution in a log log scale fitting the three models mentioned above, for this example we use an example dataset of Chilean litoral rocky shores (Kéfi et al. 2015). The table shows the fitted model information ordered by descending AIC, that is, the model in the first row is the most probable distribution, followed by the second an finally the third distribution in this case (Table 3), the Exponential distribution would be the best model, followed by the Power law model.

+
+data("chilean_intertidal")
+DegreeDistribution(chilean_intertidal)
+

Figure 9: Fitted vs observed values of the degree distribution. The black line and points show the observed values, the red, green and blue lines show the fitted values for the Exponential, power law and trucated distribution, respectively

+ ++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
logLikAICBICmodelNormal.Residfamily
83.14753-160.29506-153.63654ExpNoExponential
13.38647-20.77293-14.20397PowerNoPowerLaw
-27.4822260.9644467.53341LogExpNoExponential
-80.84172167.68343174.25240LogPowerNoPowerLaw
+

Table 4: Model selection analysis

+

The main objective of fitting the cumulative distribution of the degrees to those models, is to determine if the vulnerability of the network to the removal of the most connected species is related to their degree distribution. Networks that follow a power law distribution are very vulnerable to the removal of the most connected nodes, while networks that follow exponential degree distribution are less vulnerable to the removal of the most connected nodes (Albert and Barabási 2002; Dunne, Williams, and Martinez 2002; Estrada 2007; Santana et al. 2013).

+
+

+
+

Inter-Network Dependendancy +

+

By default, the functions in NetworkExtinction assume that, for a secondary extinction to happen, a node needs to loose all connections to its prey (if NetworkType == "Trophic") or all other nodes (if NetworkType == "Mutualistic").

+

One may also want to assume that species are only capable of sustaining existence given a threshold of remaining interaction strengths. This is implemented with the IS argument, with which one can either set a global node-dependency on interaction strengths or, alternatively, define an IS value for each node in the supplied network.

+

As a minimal example, let’s consider primary extinctions of two of the producers in our toy network not taking into account any interaction strength loss thresholds:

+
+IS_0 <- SimulateExtinctions(Network = net, Order = 1:2, Method = "Ordered")[[1]]
++++++++++++++ + @@ -136,91 +255,62 @@

- + - - - + + + + - + - - - - - - - - - - - - - + - - - + + + - - + + - - - - - - - - - - - - -
Spp S L C Link_densityModularity SecExt Pred_release Iso_nodes
61 970.08641980.777777890.11111111.00000000.2901235 1 010 1 1 2
7740.08163270.57142860 22123
57 620.05555560.33333330.12244900.85714290.0000000 13300 235
2 400.00000000.0000000134347
-

Table 1: The resulting dataframe of the Mostconnected function

-

The result of this function is the dataframe shown in table 1. The first column called Spp indicates the order in which the species were removed simulating an extinction. The column Secondary_extinctions represents the numbers of species that become extinct given that they do not have any food items left in the food web, while the AccSecExt column represents the accumulated secondary extinctions. (To plot the results, see function ExtinctionPlot.)

-
-data("net")
-history <- SimulateExtinctions(Network = net, Method = "Mostconnected")
-#> [1] 1
-#> [1] 2
-#> [1] 3
-#> [1] 4
-ExtinctionPlot(History = history, Variable = "AccSecExt")
-
-

Figure 3. The graph shows the number of accumulated secondary extinctions that occur when removing species from the most to the least connected species

-

-

-

Figure 3. The graph shows the number of accumulated secondary extinctions that occur when removing species from the most to the least connected species

- -
-
-
-

-Extinctions using a customized order

-

The ExtinctionOrder function takes a network and extinguishes nodes using a customized order. Then, it calculates the topological network indexes and the secondary extinctions.

-
-data("net")
-SimulateExtinctions(Network = net, Order = c(2,4,7), Method = "Ordered")
+

Table 5: The resulting dataframe of the basic version of SimulateExtinctions

+

As you can see, with the base version of SimulateExtinctions(), we obtain two secondary extinctions.

+

Now, let’s consider that all our species in net need to retain a minimum of 70% of interaction strength to not go extinct (rather than a 0% as is the default):

+
+IS_0.7 <- SimulateExtinctions(Network = net, Order = 1:2, Method = "Ordered", IS = 0.7)[[1]]
++++++++++++++ + @@ -230,259 +320,241 @@

- + - - - + + + + + - - - - - - - - - - - - - - + + + + - - + - - + - - +
Spp S L C Link_densityModularity SecExt Pred_release Iso_nodes
21 980.09876540.888888990.11111111.00000000.29012351 10 0 1 1 2
4750.10204080.7142857101 224
7560.12244900.85714290.0000000 30.12000000.60000002 0114 2356
-

Table 2: The resulting dataframe of the ExtinctionOrder function

-

The results of this function are a dataframe with the topological indexes of the network calculated from each extinction step (Table 2), and a plot that shows the number of accumulated secondary extinctions that occured with each removed node (Figure 4).

-
-
-

-Random extinction

-

The RandomExtinctions function generates n random extinction orders, determined by the argument nsim. The first result of this function is a dataframe (table 3). The column NumExt represents the number of species removed, AccSecExt is the average number of secondary extinctions for each species removed, and SdAccSecExt is its standard deviation. The second result is a graph (figure 5), where the x axis is the number of species removed and the y axis is the number of accumulated secondary extinctions. The solid line is the average number of secondary extinctions for every simulated primary extinction, and the red area represents the mean ± the standard deviation of the simulations.

-
-data(net)
-RandomExtinctions(Network= net, nsim= 50)
-
-

Figure 5. The resulting graph of the RandomExtinctions function

-

-

-

Figure 5. The resulting graph of the RandomExtinctions function

- -
-

###Comparison of Null hypothesis with other extinction histories

-

The RandomExtinctons function generates a null hypothesis for us to compare it with either an extinction history generated by the ExtinctionOrder function or the Mostconnected function. In order to compare the expected extinctions developed by our null hypothesis with the observed extinction history, we developed the CompareExtinctions function. The way to use this last function is to first create the extinction history and the null hypothesis, and then the CompareExtinctins function to compare both extinction histories.

-
-data("net")
-History <- SimulateExtinctions(Network = net, Order = c(1,2,3,4,5,6,7,8,9,10), Method = "Ordered")
-
-set.seed(2)
-NullHyp <- RandomExtinctions(Network = net, nsim = 100, plot = TRUE)
-
-Comparison <- CompareExtinctions(Nullmodel = NullHyp, Hypothesis = History)
-

The first result will be a graph (Figue 6) with a dashed line showing the observed extinction history and a solid line showing the expected value of secondary extinctions randomly generated.

-
-

Figure 6. The resulting graph of the CompareExtinctions function, where the dashed line shows the observed extinction history, and a solid line shows the expected value of secondary extinctions originated at random

-

-

-

Figure 6. The resulting graph of the CompareExtinctions function, where the dashed line shows the observed extinction history, and a solid line shows the expected value of secondary extinctions originated at random

- -
-
-
-
-

-Plotting the extinction histories of a network

-

The ExtinctionPlot function takes a NetworkTopology class object and plots the index of interest after every extinction. By default, the function plots the number of accumulated secondary extinctions after every primary extinction (Figure 7), but any of the indexes can be ploted with the function by changing the Variable argument (Figure 8).

-
-data(net)
-history <- SimulateExtinctions(Network = net, Method = "Mostconnected")
-#> [1] 1
-#> [1] 2
-#> [1] 3
-#> [1] 4
-ExtinctionPlot(History = history)
-
-

Figure 7. Example of the use of the ExtinctionPlot function showing the accumulated secondary extinctions against number of extinctions

-

-

-

Figure 7. Example of the use of the ExtinctionPlot function showing the accumulated secondary extinctions against number of extinctions

- -
-
-ExtinctionPlot(History = history, Variable = "Link_density")
-
-

Figure 8. Another example of the use of the ExtinctionPlot function showing the number of links per species against number of extinctions

-

-

-

Figure 8. Another example of the use of the ExtinctionPlot function showing the number of links per species against number of extinctions

- -
-
-
-

-Degree distribution function

-

The DegreeDistribution function calculates the cumulative distribution of the number of links that each species in the food network has (Estrada 2007). Then, the observed distribution is fitted to the exponential and power law distribution models.

-

The results of this function are shown in figure 9 and table 4. The graph shows the observed degree distribution in a log log scale fitting the three models mentioned above, for this example we use an example dataset of Chilean litoral rocky shores (Kéfi et al. 2015). The table shows the fitted model information ordered by descending AIC, that is, the model in the first row is the most probable distribution, followed by the second an finally the third distribution in this case (Table 3), the Exponential distribution would be the best model, followed by the Power law and finally the Truncated power law model.

-
-data("chilean_intertidal")
-DegreeDistribution(chilean_intertidal)
-
-

Figure 9: Fitted vs observed values of the degree distribution. The black line and points show the observed values, the red, green and blue lines show the fitted values for the Exponential, power law and trucated distribution, respectively

-

-

-

Figure 9: Fitted vs observed values of the degree distribution. The black line and points show the observed values, the red, green and blue lines show the fitted values for the Exponential, power law and trucated distribution, respectively

- +

Table 6: The resulting dataframe of the interaction-strength loss version of SimulateExtinctions

+

As you can see, this drastically changes how many secondary extinctions we estimate.

+
+

Rewiring Potential +

+

Ecological networks aren’t static and we should assume that species may shift their connections in response to extinctions of an association/interaction partner. Rewiring processes can be simulated with NetworkExtinction using the Rewiring, RewiringDist, and RewiringProb arguments.

+

Let’s start with RewiringDist. This should be a matrix that contains information about similarities or rewiring potential of species indexed by columns to those indexed by rows. The package comes with an example data set for this:

+
+data(dist)
+dist
+#>             1         2          3          4         5         6         7
+#> 1  0.00000000 0.4593111 0.10593644 0.30189790 0.4705959 0.1783138 0.4530299
+#> 2  0.45931109 0.0000000 0.56524753 0.76120899 0.8902942 0.5980121 0.8727282
+#> 3  0.10593644 0.5652475 0.00000000 0.19596146 0.5765323 0.2842503 0.5589664
+#> 4  0.30189790 0.7612090 0.19596146 0.00000000 0.7724938 0.4802117 0.7549278
+#> 5  0.47059588 0.8902942 0.57653232 0.77249378 0.0000000 0.2922820 0.5669981
+#> 6  0.17831383 0.5980121 0.28425027 0.48021173 0.2922820 0.0000000 0.2747161
+#> 7  0.45302992 0.8727282 0.55896636 0.75492782 0.5669981 0.2747161 0.0000000
+#> 8  0.20346538 0.6627765 0.09752893 0.09843253 0.6740613 0.3817792 0.6564953
+#> 9  0.01647744 0.4428337 0.12241388 0.31837534 0.4870733 0.1947913 0.4695074
+#> 10 0.54697008 0.4174089 0.44103364 0.63699510 0.5059987 0.7252839 1.0000000
+#>             8          9        10
+#> 1  0.20346538 0.01647744 0.5469701
+#> 2  0.66277647 0.44283365 0.4174089
+#> 3  0.09752893 0.12241388 0.4410336
+#> 4  0.09843253 0.31837534 0.6369951
+#> 5  0.67406125 0.48707331 0.5059987
+#> 6  0.38177920 0.19479127 0.7252839
+#> 7  0.65649529 0.46950735 1.0000000
+#> 8  0.00000000 0.21994281 0.5385626
+#> 9  0.21994281 0.00000000 0.5634475
+#> 10 0.53856257 0.56344752 0.0000000
+

This is a random distance matrix. For the sake of this example, we assume that these values represent probabilities of rewiring. We have to tweak it a bit to make it useful for our toy example of a trophic network, we do so by setting some of the values to 0:

+
+dist[,1:4] <- 0 # producers don't worry about rewiring
+dist[5:10,5:8] <- 0 # intermediate consumders can only rewire to producers
+dist[c(1:4, 9:10), 9:10] <- 0 # apex predators can only rewire to intermediate consumers
+dist
+#>    1 2 3 4         5         6         7          8         9        10
+#> 1  0 0 0 0 0.4705959 0.1783138 0.4530299 0.20346538 0.0000000 0.0000000
+#> 2  0 0 0 0 0.8902942 0.5980121 0.8727282 0.66277647 0.0000000 0.0000000
+#> 3  0 0 0 0 0.5765323 0.2842503 0.5589664 0.09752893 0.0000000 0.0000000
+#> 4  0 0 0 0 0.7724938 0.4802117 0.7549278 0.09843253 0.0000000 0.0000000
+#> 5  0 0 0 0 0.0000000 0.0000000 0.0000000 0.00000000 0.4870733 0.5059987
+#> 6  0 0 0 0 0.0000000 0.0000000 0.0000000 0.00000000 0.1947913 0.7252839
+#> 7  0 0 0 0 0.0000000 0.0000000 0.0000000 0.00000000 0.4695074 1.0000000
+#> 8  0 0 0 0 0.0000000 0.0000000 0.0000000 0.00000000 0.2199428 0.5385626
+#> 9  0 0 0 0 0.0000000 0.0000000 0.0000000 0.00000000 0.0000000 0.0000000
+#> 10 0 0 0 0 0.0000000 0.0000000 0.0000000 0.00000000 0.0000000 0.0000000
+

This matrix makes a lot more sense for our purposes. To clarify once more how to read this data: species 8 (column) has a .663 chance of rewiring to species 2 (row).

+

Next, Rewiring is a function argument that, just like the IS argument can be set globally or individually for each node. It is used to calculate probabilities of rewiring from the data in RewiringDist. Since we assume RewiringDist to already contain probabilities in this example, we simply set RewiringDist to return the data without changing it:

+
+RewiringDist <- function(x){x}
+

Lastly, RewiringProb is called upon to determine whether rewiring can happen among all potential rewiring partners. If no potential rewiring partner comes with a probability higher than this threshold, no rewiring happens. If multiple potential partners meet this threshold, rewiring happens only to the potential partner with the highest probability. Let’s keep the default of 50% here.

+

Finally, let’s out this all together with the IS example from above. Can we reduce the number of secondary extinctions when allowing for rewiring?

+
+Rewiring <- SimulateExtinctions(Network = net, Order = 1:2, Method = "Ordered", IS = 0.7,
+                              Rewiring = function(x){x}, RewiringDist = dist, RewiringProb = 0.5)[[1]]
++++++++++++++ - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + +
logLikAICBICmodelNormal.ResidfamilySppSLCLink_densityModularitySecExtPred_releaseIso_nodesAccSecExtNumExtTotalExt
83.14753-160.29506-153.63654ExpNoExponential
13.38647-20.77293-14.20397PowerNoPowerLaw
-27.4822260.9644467.53341LogExpNoExponential1990.11111111.00000000.2901235110112
-80.84172167.68343174.25240LogPowerNoPowerLaw2760.12244900.85714290.0000000210325
-

Table 4: Model selection analysis

-

The main objective of fitting the cumulative distribution of the degrees to those models, is to determine if the vulnerability of the network to the removal of the most connected species is related to their degree distribution. Networks that follow a power law distribution are very vulnerable to the removal of the most connected nodes, while networks that follow exponential degree distribution are less vulnerable to the removal of the most connected nodes (Albert and Barabási 2002; Dunne, Williams, and Martinez 2002; Estrada 2007; Santana et al. 2013).

-
+

Table 7: The resulting dataframe of the rewiring version of SimulateExtinctions

+

Indeed, this made it so we have one less secondary extinction at the second primary extinction!

-
-

-Bibliography

-
-
-

Albert, Réka, and Albert-László Barabási. 2002. “Statistical Mechanics of Complex Networks.” Reviews of Modern Physics 74 (1). APS: 47.

+
+

Bibliography +

+
+
+Albert, Réka, and Albert-László Barabási. 2002. “Statistical Mechanics of Complex Networks.” Reviews of Modern Physics 74 (1): 47.
-
-

Dunne, Jennifer A, and Richard J Williams. 2009. “Cascading Extinctions and Community Collapse in Model Food Webs.” Philosophical Transactions of the Royal Society B: Biological Sciences 364 (1524). The Royal Society: 1711–23.

+
+Dunne, Jennifer A, and Richard J Williams. 2009. “Cascading Extinctions and Community Collapse in Model Food Webs.” Philosophical Transactions of the Royal Society B: Biological Sciences 364 (1524): 1711–23.
-
-

Dunne, Jennifer A, Richard J Williams, and Neo D Martinez. 2002. “Food-Web Structure and Network Theory: The Role of Connectance and Size.” Proceedings of the National Academy of Sciences 99 (20). National Acad Sciences: 12917–22.

+
+Dunne, Jennifer A, Richard J Williams, and Neo D Martinez. 2002. “Food-Web Structure and Network Theory: The Role of Connectance and Size.” Proceedings of the National Academy of Sciences 99 (20): 12917–22.
-
-

Estrada, Ernesto. 2007. “Food Webs Robustness to Biodiversity Loss: The Roles of Connectance, Expansibility and Degree Distribution.” Journal of Theoretical Biology 244 (2). Elsevier: 296–307.

+
+Estrada, Ernesto. 2007. “Food Webs Robustness to Biodiversity Loss: The Roles of Connectance, Expansibility and Degree Distribution.” Journal of Theoretical Biology 244 (2): 296–307.
-
-

Kéfi, Sonia, Eric L Berlow, Evie A Wieters, Lucas N Joppa, Spencer A Wood, Ulrich Brose, and Sergio A Navarrete. 2015. “Network Structure Beyond Food Webs: Mapping Non-Trophic and Trophic Interactions on Chilean Rocky Shores.” Ecology 96 (1). Wiley Online Library: 291–303.

+
+Kéfi, Sonia, Eric L Berlow, Evie A Wieters, Lucas N Joppa, Spencer A Wood, Ulrich Brose, and Sergio A Navarrete. 2015. “Network Structure Beyond Food Webs: Mapping Non-Trophic and Trophic Interactions on Chilean Rocky Shores.” Ecology 96 (1): 291–303.
-
-

Santana, Charles N de, Alejandro F Rozenfeld, Pablo A Marquet, and Carlos M Duarte. 2013. “Topological Properties of Polar Food Webs.” Marine Ecology Progress Series 474: 15–26.

+
+Santana, Charles N de, Alejandro F Rozenfeld, Pablo A Marquet, and Carlos M Duarte. 2013. “Topological Properties of Polar Food Webs.” Marine Ecology Progress Series 474: 15–26.
-
-

Sole, Ricard V, and M Montoya. 2001. “Complexity and Fragility in Ecological Networks.” Proceedings of the Royal Society of London B: Biological Sciences 268 (1480). The Royal Society: 2039–45.

+
+Sole, Ricard V, and M Montoya. 2001. “Complexity and Fragility in Ecological Networks.” Proceedings of the Royal Society of London B: Biological Sciences 268 (1480): 2039–45.
-
- - + diff --git a/docs/news/index.html b/docs/news/index.html index d226e07..914e953 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -1,202 +1,88 @@ - - - - - - - -Changelog • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Changelog • NetworkExtinction + + Skip to contents + +
-
- +
- +
- -
-
-
+
+ - - - + diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 7e7048f..5fccd9c 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -2,70 +2,30 @@ (function($) { $(function() { - $('.navbar-fixed-top').headroom(); + $('nav.navbar').headroom(); - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); + Toc.init({ + $nav: $("#toc"), + $scope: $("main h2, main h3, main h4, main h5, main h6") }); - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); + if ($('#toc').length) { + $('body').scrollspy({ + target: '#toc', + offset: $("nav.navbar").outerHeight() + 1 + }); } - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } + // Activate popovers + $('[data-bs-toggle="popover"]').popover({ + container: 'body', + html: true, + trigger: 'focus', + placement: "top", + sanitize: false, + }); - return(haystack.length); - } + $('[data-bs-toggle="tooltip"]').tooltip(); /* Clipboard --------------------------*/ @@ -78,9 +38,9 @@ if(ClipboardJS.isSupported()) { $(document).ready(function() { - var copyButton = ""; + var copyButton = ""; - $(".examples, div.sourceCode").addClass("hasCopyButton"); + $("div.sourceCode").addClass("hasCopyButton"); // Insert copy buttons: $(copyButton).prependTo(".hasCopyButton"); @@ -89,20 +49,108 @@ $('.btn-copy-ex').tooltip({container: 'body'}); // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + var clipboard = new ClipboardJS('[data-clipboard-copy]', { text: function(trigger) { - return trigger.parentNode.textContent; + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); } }); - clipboardBtnCopies.on('success', function(e) { + clipboard.on('success', function(e) { changeTooltipMessage(e.trigger, 'Copied!'); e.clearSelection(); }); - clipboardBtnCopies.on('error', function() { + clipboard.on('error', function() { changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); }); + }); } + + /* Search marking --------------------------*/ + var url = new URL(window.location.href); + var toMark = url.searchParams.get("q"); + var mark = new Mark("main#main"); + if (toMark) { + mark.mark(toMark, { + accuracy: { + value: "complementary", + limiters: [",", ".", ":", "/"], + } + }); + } + + /* Search --------------------------*/ + /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ + // Initialise search index on focus + var fuse; + $("#search-input").focus(async function(e) { + if (fuse) { + return; + } + + $(e.target).addClass("loading"); + var response = await fetch($("#search-input").data("search-index")); + var data = await response.json(); + + var options = { + keys: ["what", "text", "code"], + ignoreLocation: true, + threshold: 0.1, + includeMatches: true, + includeScore: true, + }; + fuse = new Fuse(data, options); + + $(e.target).removeClass("loading"); + }); + + // Use algolia autocomplete + var options = { + autoselect: true, + debug: true, + hint: false, + minLength: 2, + }; + var q; +async function searchFuse(query, callback) { + await fuse; + + var items; + if (!fuse) { + items = []; + } else { + q = query; + var results = fuse.search(query, { limit: 20 }); + items = results + .filter((x) => x.score <= 0.75) + .map((x) => x.item); + if (items.length === 0) { + items = [{dir:"Sorry 😿",previous_headings:"",title:"No results found.",what:"No results found.",path:window.location.href}]; + } + } + callback(items); +} + $("#search-input").autocomplete(options, [ + { + name: "content", + source: searchFuse, + templates: { + suggestion: (s) => { + if (s.title == s.what) { + return `${s.dir} >
    ${s.title}
    `; + } else if (s.previous_headings == "") { + return `${s.dir} >
    ${s.title}
    > ${s.what}`; + } else { + return `${s.dir} >
    ${s.title}
    > ${s.previous_headings} > ${s.what}`; + } + }, + }, + }, + ]).on('autocomplete:selected', function(event, s) { + window.location.href = s.path + "?q=" + q + "#" + s.id; + }); + }); })(window.jQuery || window.$) + + diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 394ddec..9eaf99b 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,7 +1,7 @@ -pandoc: 2.3.1 -pkgdown: 1.6.1 +pandoc: 2.17.1.1 +pkgdown: 2.0.6 pkgdown_sha: ~ articles: - How_to_use_the_NetworkExtinction_Package: How_to_use_the_NetworkExtinction_Package.html -last_built: 2021-02-16T03:05Z + NetworkExtinction: NetworkExtinction.html +last_built: 2022-10-07T18:55Z diff --git a/docs/reference/CompareExtinctions.html b/docs/reference/CompareExtinctions.html index ac48b74..c28e537 100644 --- a/docs/reference/CompareExtinctions.html +++ b/docs/reference/CompareExtinctions.html @@ -1,205 +1,113 @@ - - - - - - - -Comparison of Null hypothesis with other extinction histories — CompareExtinctions • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +RandomExtinctions is in plot = T.">Comparison of Null hypothesis with other extinction histories — CompareExtinctions • NetworkExtinction + Skip to contents + +
    +
    +
    -
    -

    It compares an object genrated either by the Mostconnected or ExtinctionOrder functions +

    +

    It compares an object generated either by the Mostconnected or ExtinctionOrder functions with a null hypothesis generated by the RandomExtinctions function it is important that RandomExtinctions is in plot = T.

    -
    CompareExtinctions(Nullmodel, Hypothesis)
    - -

    Arguments

    - - - - - - - - - - -
    Nullmodel

    an object generated by the RandomExtinctions

    Hypothesis

    Extinction history generated by the Mostconnected or ExtinctionOrder -fuction

    - -

    Value

    - -

    a plot comparing the expected value of secondary extinctions originated at random -with the observed extinction history.

    -

    Author

    +
    +

    Usage

    +
    CompareExtinctions(Nullmodel, Hypothesis)
    +
    + +
    +

    Arguments

    +
    Nullmodel
    +

    an object generated by the RandomExtinctions

    + +
    Hypothesis
    +

    Extinction history generated by the Mostconnected or ExtinctionOrder +fuction

    + +
    +
    +

    Value

    + + +

    a plot comparing the expected value of secondary extinctions originated at random +with the observed extinction history.

    +
    +
    +

    Author

    Derek Corcoran <derek.corcoran.barrios@gmail.com>

    M. Isidora Ávila-Thieme <msavila@uc.cl>

    +
    -

    Examples

    -
    data("net") -History <- SimulateExtinctions(Network = net, Method = "Mostconnected") -
    #> [1] 1 -#> [1] 2 -#> [1] 3 -#> [1] 4
    -NullHyp <- RandomExtinctions(Network = net, nsim = 100, plot = TRUE) -
    #> 1
    #> 2
    #> 3
    #> 4
    #> Simulation 1 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 2 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 3 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 4 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 5 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 6 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 7 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 8 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 9 of 100 ready
    #> 1
    #> 2
    #> 3
    #> Simulation 10 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 11 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 12 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 13 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 14 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 15 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 16 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 17 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 18 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 19 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 20 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 21 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 22 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 23 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 24 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 25 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> Simulation 26 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 27 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 28 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 29 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 30 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 31 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 32 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 33 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 34 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 35 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 36 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 37 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 38 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 39 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> Simulation 40 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 41 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 42 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 43 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 44 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 45 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 46 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 47 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 48 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 49 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 50 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 51 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 52 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 53 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 54 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 55 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Warning: Density is not well-defined for networks of order 0.
    #> 9
    #> Simulation 56 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 57 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 58 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 59 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 60 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 61 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 62 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 63 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 64 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 65 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 66 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 67 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 68 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 69 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 70 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 71 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 72 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 73 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 74 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 75 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 76 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 77 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 78 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 79 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 80 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 81 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 82 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 83 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 84 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 85 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 86 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 87 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 88 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 89 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 90 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 91 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 92 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 93 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 94 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> Simulation 95 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 96 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Simulation 97 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> Simulation 98 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> Simulation 99 of 100 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> Simulation 100 of 100 ready
    -CompareExtinctions(Nullmodel = NullHyp, Hypothesis = History) -
    -
    - -
    +
    +

    Examples

    +
    if (FALSE) {
    +data("Less_Connected")
    +History <- SimulateExtinctions(Network = Less_Connected, Method = "Mostconnected")
    +NullHyp <- RandomExtinctions(Network = Less_Connected, nsim = 100)
    +CompareExtinctions(Nullmodel = NullHyp, Hypothesis = History)
    +}
    +
    +
    +
    -
    - +
  • + - - - + diff --git a/docs/reference/DegreeDistribution-1.png b/docs/reference/DegreeDistribution-1.png index 19eeda8..2a33d16 100644 Binary files a/docs/reference/DegreeDistribution-1.png and b/docs/reference/DegreeDistribution-1.png differ diff --git a/docs/reference/DegreeDistribution.html b/docs/reference/DegreeDistribution.html index 6d0d291..a2554fe 100644 --- a/docs/reference/DegreeDistribution.html +++ b/docs/reference/DegreeDistribution.html @@ -1,141 +1,56 @@ - - - - - - - -Degree distribution of the network — DegreeDistribution • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Skip to contents + +
    +
    +
    -
    +

    This function calculates the degree distribution of the network. First it fits exponential, power law and truncated power law distribution models, and calculates the AIC values to select the best fit, and finally it plots @@ -143,229 +58,241 @@

    Degree distribution of the network

    mentioned above against the observed distribution.

    -
    DegreeDistribution(Network, scale = "arithmetic")
    +
    +

    Usage

    +
    DegreeDistribution(Network, scale = "arithmetic")
    +
    + +
    +

    Arguments

    +
    Network
    +

    a trophic network of class network

    + -

    Arguments

    - - - - - - - - - - -
    Network

    a trophic network of class network

    scale

    a character stating if the graph is on a log-log scale -("LogLog") or arithmetic scale ("arithmetic"), defaults to arithmetic

    +
    scale
    +

    a character stating if the graph is on a log-log scale +("LogLog") or arithmetic scale ("arithmetic"), defaults to arithmetic

    -

    Value

    +
    +
    +

    Value

    + -

    exports three principal results: +

    exports three principal results: 1. A list with network degree distribution values and with the value of each fit model 2. A list with each model results and AIC of the distribution models 3. A Ghraph of the degree distribution with the models adjust In DDvalues, k represent the degree of the network and cumulative the probability that each specie could be have this degree (pk). Observation: In the graph, the zero values are not represented but this result are incorporate in the DF result

    -

    Author

    - +
    +
    +

    Author

    Derek Corcoran <derek.corcoran.barrios@gmail.com>

    M.Isidora Avila Thieme <msavila@uc.cl>

    +
    -

    Examples

    -
    library(NetworkExtinction) -data("chilean_intertidal") -DegreeDistribution(chilean_intertidal) -
    #> Joining, by = c("K", "Cumulative", "LogK", "LogCum", "Exp")
    #> Joining, by = c("K", "Cumulative", "LogK", "LogCum", "Exp", "LogExp", "LogPower")
    #> Joining, by = c("sigma", "isConv", "finTol", "logLik", "AIC", "BIC", "deviance", "df.residual", "nobs", "model", "Normal.Resid", "family", "AICcNorm")
    #> Joining, by = c("logLik", "AIC", "BIC", "deviance", "df.residual", "nobs", "model", "Normal.Resid", "family", "AICcNorm")
    #> Joining, by = c("logLik", "AIC", "BIC", "deviance", "df.residual", "nobs", "model", "Normal.Resid", "family", "AICcNorm", "null.deviance", "df.null")
    #> $DDvalues -#> K Cumulative LogK LogCum Exp LogExp LogPower -#> 1 0 1.000000000 -Inf 0.00000000 1.17799969 NA NA -#> 2 1 1.000000000 0.0000000 0.00000000 1.12910049 1.83049523 9.44903010 -#> 3 2 1.000000000 0.6931472 0.00000000 1.08223111 1.70946324 4.12868593 -#> 4 3 0.943925234 1.0986123 -0.05770832 1.03730730 1.59643387 2.54374592 -#> 5 4 0.934579439 1.3862944 -0.06765865 0.99424830 1.49087797 1.80399970 -#> 6 5 0.915887850 1.6094379 -0.08786136 0.95297669 1.39230142 1.38190772 -#> 7 6 0.906542056 1.7917595 -0.09811786 0.91341828 1.30024272 1.11147154 -#> 8 7 0.906542056 1.9459101 -0.09811786 0.87550195 1.21427093 0.92455235 -#> 9 8 0.897196262 2.0794415 -0.10848064 0.83915954 1.13398357 0.78824473 -#> 10 9 0.869158879 2.1972246 -0.14022934 0.80432572 1.05900480 0.68479445 -#> 11 10 0.859813084 2.3025851 -0.15104026 0.77093787 0.98898361 0.60381467 -#> 12 11 0.822429907 2.3978953 -0.19549202 0.73893595 0.92359221 0.53884118 -#> 13 12 0.785046729 2.4849066 -0.24201204 0.70826245 0.86252447 0.48564952 -#> 14 13 0.757009346 2.5649494 -0.27837968 0.67886222 0.80549453 0.44136734 -#> 15 14 0.728971963 2.6390573 -0.31612001 0.65068240 0.75223539 0.40397652 -#> 16 15 0.691588785 2.7080502 -0.36876374 0.62367233 0.70249773 0.37201936 -#> 17 16 0.663551402 2.7725887 -0.41014896 0.59778347 0.65604872 0.34441788 -#> 18 17 0.663551402 2.8332133 -0.41014896 0.57296925 0.61267091 0.32035847 -#> 19 18 0.626168224 2.8903718 -0.46813622 0.54918509 0.57216123 0.29921602 -#> 20 19 0.588785047 2.9444390 -0.52969411 0.52638822 0.53433004 0.28050271 -#> 21 20 0.588785047 2.9957323 -0.52969411 0.50453765 0.49900024 0.26383249 -#> 22 21 0.570093458 3.0445224 -0.56195497 0.48359411 0.46600644 0.24889605 -#> 23 22 0.560747664 3.0910425 -0.57848427 0.46351994 0.43519419 0.23544279 -#> 24 23 0.542056075 3.1354942 -0.61238582 0.44427905 0.40641923 0.22326760 -#> 25 24 0.495327103 3.1780538 -0.70253692 0.42583687 0.37954688 0.21220107 -#> 26 25 0.495327103 3.2188758 -0.70253692 0.40816022 0.35445131 0.20210211 -#> 27 26 0.467289720 3.2580965 -0.76080583 0.39121734 0.33101506 0.19285229 -#> 28 27 0.420560748 3.2958369 -0.86616634 0.37497777 0.30912841 0.18435152 -#> 29 28 0.420560748 3.3322045 -0.86616634 0.35941230 0.28868890 0.17651464 -#> 30 29 0.383177570 3.3672958 -0.95925677 0.34449297 0.26960085 0.16926877 -#> 31 30 0.327102804 3.4011974 -1.11748077 0.33019294 0.25177489 0.16255119 -#> 32 31 0.299065421 3.4339872 -1.20709293 0.31648651 0.23512758 0.15630763 -#> 33 32 0.299065421 3.4657359 -1.20709293 0.30334904 0.21958099 0.15049092 -#> 34 33 0.299065421 3.4965076 -1.20709293 0.29075691 0.20506234 0.14505987 -#> 35 34 0.289719626 3.5263605 -1.23884163 0.27868748 0.19150366 0.13997833 -#> 36 35 0.271028037 3.5553481 -1.30553300 0.26711906 0.17884148 0.13521452 -#> 37 36 0.242990654 3.5835189 -1.41473230 0.25603085 0.16701651 0.13074029 -#> 38 37 0.205607477 3.6109179 -1.58178638 0.24540292 0.15597341 0.12653074 -#> 39 38 0.186915888 3.6375862 -1.67709656 0.23521615 0.14566048 0.12256365 -#> 40 39 0.140186916 3.6635616 -1.96477863 0.22545224 0.13602944 0.11881922 -#> 41 40 0.130841121 3.6888795 -2.03377150 0.21609364 0.12703520 0.11527971 -#> 42 41 0.102803738 3.7135721 -2.27493356 0.20712351 0.11863566 0.11192920 -#> 43 42 0.102803738 3.7376696 -2.27493356 0.19852574 0.11079149 0.10875334 -#> 44 43 0.093457944 3.7612001 -2.37024374 0.19028486 0.10346598 0.10573919 -#> 45 44 0.093457944 3.7841896 -2.37024374 0.18238607 0.09662483 0.10287504 -#> 46 45 0.093457944 3.8066625 -2.37024374 0.17481516 0.09023601 0.10015025 -#> 47 46 0.093457944 3.8286414 -2.37024374 0.16755851 0.08426963 0.09755518 -#> 48 47 0.084112150 3.8501476 -2.47560426 0.16060310 0.07869774 0.09508101 -#> 49 48 0.084112150 3.8712010 -2.47560426 0.15393641 0.07349426 0.09271974 -#> 50 49 0.084112150 3.8918203 -2.47560426 0.14754645 0.06863483 0.09046400 -#> 51 50 0.084112150 3.9120230 -2.47560426 0.14142174 0.06409671 0.08830707 -#> 52 51 0.084112150 3.9318256 -2.47560426 0.13555127 0.05985865 0.08624277 -#> 53 52 0.074766355 3.9512437 -2.59338729 0.12992449 0.05590081 0.08426543 -#> 54 53 0.074766355 3.9702919 -2.59338729 0.12453128 0.05220466 0.08236980 -#> 55 54 0.074766355 3.9889840 -2.59338729 0.11936194 0.04875289 0.08055108 -#> 56 55 0.074766355 4.0073332 -2.59338729 0.11440718 0.04552936 0.07880478 -#> 57 56 0.056074766 4.0253517 -2.88106937 0.10965810 0.04251897 0.07712681 -#> 58 57 0.046728972 4.0430513 -3.06339092 0.10510615 0.03970762 0.07551332 -#> 59 58 0.046728972 4.0604430 -3.06339092 0.10074315 0.03708216 0.07396078 -#> 60 59 0.037383178 4.0775374 -3.28653447 0.09656127 0.03463030 0.07246588 -#> 61 60 0.018691589 4.0943446 -3.97968165 0.09255298 0.03234055 0.07102558 -#> 62 61 0.018691589 4.1108739 -3.97968165 0.08871107 0.03020220 0.06963700 -#> 63 62 0.018691589 4.1271344 -3.97968165 0.08502864 0.02820524 0.06829750 -#> 64 63 0.009345794 4.1431347 -4.67282883 0.08149907 0.02634031 0.06700458 -#> 65 64 0.009345794 4.1588831 -4.67282883 0.07811601 0.02459869 0.06575593 -#> 66 65 0.009345794 4.1743873 -4.67282883 0.07487339 0.02297223 0.06454937 -#> 67 66 0.009345794 4.1896547 -4.67282883 0.07176537 0.02145331 0.06338287 -#> 68 67 0.000000000 4.2046926 -Inf 0.06878636 NA NA -#> Power -#> 1 NA -#> 2 1.5397399 -#> 3 1.1281356 -#> 4 0.9404615 -#> 5 0.8265616 -#> 6 0.7478031 -#> 7 0.6890567 -#> 8 0.6430028 -#> 9 0.6056046 -#> 10 0.5744268 -#> 11 0.5478999 -#> 12 0.5249602 -#> 13 0.5048576 -#> 14 0.4870455 -#> 15 0.4711148 -#> 16 0.4567525 -#> 17 0.4437140 -#> 18 0.4318054 -#> 19 0.4208706 -#> 20 0.4107822 -#> 21 0.4014349 -#> 22 0.3927412 -#> 23 0.3846275 -#> 24 0.3770311 -#> 25 0.3698987 -#> 26 0.3631844 -#> 27 0.3568482 -#> 28 0.3508555 -#> 29 0.3451761 -#> 30 0.3397832 -#> 31 0.3346531 -#> 32 0.3297650 -#> 33 0.3251001 -#> 34 0.3206417 -#> 35 0.3163749 -#> 36 0.3122862 -#> 37 0.3083632 -#> 38 0.3045950 -#> 39 0.3009716 -#> 40 0.2974837 -#> 41 0.2941231 -#> 42 0.2908819 -#> 43 0.2877534 -#> 44 0.2847309 -#> 45 0.2818086 -#> 46 0.2789810 -#> 47 0.2762429 -#> 48 0.2735898 -#> 49 0.2710172 -#> 50 0.2685210 -#> 51 0.2660977 -#> 52 0.2637435 -#> 53 0.2614553 -#> 54 0.2592299 -#> 55 0.2570646 -#> 56 0.2549566 -#> 57 0.2529034 -#> 58 0.2509026 -#> 59 0.2489521 -#> 60 0.2470497 -#> 61 0.2451934 -#> 62 0.2433814 -#> 63 0.2416120 -#> 64 0.2398834 -#> 65 0.2381941 -#> 66 0.2365426 -#> 67 0.2349276 -#> 68 NA -#> -#> $models -#> # A tibble: 4 x 6 -#> logLik AIC BIC model Normal.Resid family -#> <dbl> <dbl> <dbl> <chr> <chr> <chr> -#> 1 83.1 -160. -154. Exp No Exponential -#> 2 13.4 -20.8 -14.2 Power No PowerLaw -#> 3 -27.5 61.0 67.5 LogExp No Exponential -#> 4 -80.8 168. 174. LogPower No PowerLaw -#> -#> $graph
    #> Warning: Removed 20 row(s) containing missing values (geom_path).
    #> -#> $params -#> # A tibble: 8 x 6 -#> term estimate std.error statistic p.value model -#> <chr> <dbl> <dbl> <dbl> <dbl> <chr> -#> 1 c 2.25 0.384 5.84 1.87e- 7 LogPower -#> 2 Beta -1.19 0.114 -10.4 1.90e-15 LogPower -#> 3 Beta -0.449 0.0402 -11.2 1.13e-16 Power -#> 4 c 1.54 0.150 10.3 3.63e-15 Power -#> 5 c 0.673 0.0928 7.25 6.68e-10 LogExp -#> 6 Lambda -0.0684 0.00241 -28.4 5.33e-38 LogExp -#> 7 Lambda -0.0424 0.00157 -27.0 2.31e-37 Exp -#> 8 c 0.164 0.0247 6.63 7.39e- 9 Exp -#>
    -
    -
    - -
    +
    +

    Examples

    +
    library(NetworkExtinction)
    +data("chilean_intertidal")
    +DegreeDistribution(chilean_intertidal)
    +#> Joining, by = c("K", "Cumulative", "LogK", "LogCum", "Exp")
    +#> Joining, by = c("K", "Cumulative", "LogK", "LogCum", "Exp", "LogExp",
    +#> "LogPower")
    +#> Joining, by = c("sigma", "isConv", "finTol", "logLik", "AIC", "BIC",
    +#> "deviance", "df.residual", "nobs", "model", "Normal.Resid", "family",
    +#> "AICcNorm")
    +#> Joining, by = c("logLik", "AIC", "BIC", "deviance", "df.residual", "nobs",
    +#> "model", "Normal.Resid", "family", "AICcNorm")
    +#> Joining, by = c("logLik", "AIC", "BIC", "deviance", "df.residual", "nobs",
    +#> "model", "Normal.Resid", "family", "AICcNorm", "null.deviance", "df.null")
    +#> $DDvalues
    +#>     K  Cumulative      LogK      LogCum        Exp     LogExp   LogPower
    +#> 1   0 1.000000000      -Inf  0.00000000 1.17799969         NA         NA
    +#> 2   1 1.000000000 0.0000000  0.00000000 1.12910049 1.83049523 9.44903010
    +#> 3   2 1.000000000 0.6931472  0.00000000 1.08223111 1.70946324 4.12868593
    +#> 4   3 0.943925234 1.0986123 -0.05770832 1.03730730 1.59643387 2.54374592
    +#> 5   4 0.934579439 1.3862944 -0.06765865 0.99424830 1.49087797 1.80399970
    +#> 6   5 0.915887850 1.6094379 -0.08786136 0.95297668 1.39230142 1.38190772
    +#> 7   6 0.906542056 1.7917595 -0.09811786 0.91341827 1.30024272 1.11147154
    +#> 8   7 0.906542056 1.9459101 -0.09811786 0.87550195 1.21427093 0.92455235
    +#> 9   8 0.897196262 2.0794415 -0.10848064 0.83915954 1.13398357 0.78824473
    +#> 10  9 0.869158879 2.1972246 -0.14022934 0.80432572 1.05900480 0.68479445
    +#> 11 10 0.859813084 2.3025851 -0.15104026 0.77093786 0.98898361 0.60381467
    +#> 12 11 0.822429907 2.3978953 -0.19549202 0.73893595 0.92359221 0.53884118
    +#> 13 12 0.785046729 2.4849066 -0.24201204 0.70826245 0.86252447 0.48564952
    +#> 14 13 0.757009346 2.5649494 -0.27837968 0.67886222 0.80549453 0.44136734
    +#> 15 14 0.728971963 2.6390573 -0.31612001 0.65068240 0.75223539 0.40397652
    +#> 16 15 0.691588785 2.7080502 -0.36876374 0.62367233 0.70249773 0.37201936
    +#> 17 16 0.663551402 2.7725887 -0.41014896 0.59778346 0.65604872 0.34441788
    +#> 18 17 0.663551402 2.8332133 -0.41014896 0.57296925 0.61267091 0.32035847
    +#> 19 18 0.626168224 2.8903718 -0.46813622 0.54918509 0.57216123 0.29921602
    +#> 20 19 0.588785047 2.9444390 -0.52969411 0.52638822 0.53433004 0.28050271
    +#> 21 20 0.588785047 2.9957323 -0.52969411 0.50453765 0.49900024 0.26383249
    +#> 22 21 0.570093458 3.0445224 -0.56195497 0.48359411 0.46600644 0.24889605
    +#> 23 22 0.560747664 3.0910425 -0.57848427 0.46351994 0.43519419 0.23544279
    +#> 24 23 0.542056075 3.1354942 -0.61238582 0.44427905 0.40641923 0.22326760
    +#> 25 24 0.495327103 3.1780538 -0.70253692 0.42583687 0.37954688 0.21220107
    +#> 26 25 0.495327103 3.2188758 -0.70253692 0.40816022 0.35445131 0.20210211
    +#> 27 26 0.467289720 3.2580965 -0.76080583 0.39121734 0.33101506 0.19285229
    +#> 28 27 0.420560748 3.2958369 -0.86616634 0.37497777 0.30912841 0.18435152
    +#> 29 28 0.420560748 3.3322045 -0.86616634 0.35941230 0.28868890 0.17651464
    +#> 30 29 0.383177570 3.3672958 -0.95925677 0.34449297 0.26960085 0.16926877
    +#> 31 30 0.327102804 3.4011974 -1.11748077 0.33019294 0.25177489 0.16255119
    +#> 32 31 0.299065421 3.4339872 -1.20709293 0.31648651 0.23512758 0.15630763
    +#> 33 32 0.299065421 3.4657359 -1.20709293 0.30334904 0.21958099 0.15049092
    +#> 34 33 0.299065421 3.4965076 -1.20709293 0.29075691 0.20506234 0.14505987
    +#> 35 34 0.289719626 3.5263605 -1.23884163 0.27868748 0.19150366 0.13997833
    +#> 36 35 0.271028037 3.5553481 -1.30553300 0.26711906 0.17884148 0.13521452
    +#> 37 36 0.242990654 3.5835189 -1.41473230 0.25603085 0.16701651 0.13074029
    +#> 38 37 0.205607477 3.6109179 -1.58178638 0.24540292 0.15597341 0.12653074
    +#> 39 38 0.186915888 3.6375862 -1.67709656 0.23521615 0.14566048 0.12256365
    +#> 40 39 0.140186916 3.6635616 -1.96477863 0.22545224 0.13602944 0.11881922
    +#> 41 40 0.130841121 3.6888795 -2.03377150 0.21609364 0.12703520 0.11527971
    +#> 42 41 0.102803738 3.7135721 -2.27493356 0.20712351 0.11863566 0.11192920
    +#> 43 42 0.102803738 3.7376696 -2.27493356 0.19852574 0.11079149 0.10875334
    +#> 44 43 0.093457944 3.7612001 -2.37024374 0.19028486 0.10346598 0.10573919
    +#> 45 44 0.093457944 3.7841896 -2.37024374 0.18238607 0.09662483 0.10287504
    +#> 46 45 0.093457944 3.8066625 -2.37024374 0.17481516 0.09023601 0.10015025
    +#> 47 46 0.093457944 3.8286414 -2.37024374 0.16755852 0.08426963 0.09755518
    +#> 48 47 0.084112150 3.8501476 -2.47560426 0.16060310 0.07869774 0.09508101
    +#> 49 48 0.084112150 3.8712010 -2.47560426 0.15393641 0.07349426 0.09271974
    +#> 50 49 0.084112150 3.8918203 -2.47560426 0.14754645 0.06863483 0.09046400
    +#> 51 50 0.084112150 3.9120230 -2.47560426 0.14142174 0.06409671 0.08830707
    +#> 52 51 0.084112150 3.9318256 -2.47560426 0.13555127 0.05985865 0.08624277
    +#> 53 52 0.074766355 3.9512437 -2.59338729 0.12992449 0.05590081 0.08426543
    +#> 54 53 0.074766355 3.9702919 -2.59338729 0.12453128 0.05220466 0.08236980
    +#> 55 54 0.074766355 3.9889840 -2.59338729 0.11936194 0.04875289 0.08055108
    +#> 56 55 0.074766355 4.0073332 -2.59338729 0.11440718 0.04552936 0.07880478
    +#> 57 56 0.056074766 4.0253517 -2.88106937 0.10965810 0.04251897 0.07712681
    +#> 58 57 0.046728972 4.0430513 -3.06339092 0.10510615 0.03970762 0.07551332
    +#> 59 58 0.046728972 4.0604430 -3.06339092 0.10074315 0.03708216 0.07396078
    +#> 60 59 0.037383178 4.0775374 -3.28653447 0.09656127 0.03463030 0.07246588
    +#> 61 60 0.018691589 4.0943446 -3.97968165 0.09255298 0.03234055 0.07102558
    +#> 62 61 0.018691589 4.1108739 -3.97968165 0.08871107 0.03020220 0.06963700
    +#> 63 62 0.018691589 4.1271344 -3.97968165 0.08502864 0.02820524 0.06829750
    +#> 64 63 0.009345794 4.1431347 -4.67282883 0.08149907 0.02634031 0.06700458
    +#> 65 64 0.009345794 4.1588831 -4.67282883 0.07811601 0.02459869 0.06575593
    +#> 66 65 0.009345794 4.1743873 -4.67282883 0.07487339 0.02297223 0.06454937
    +#> 67 66 0.009345794 4.1896547 -4.67282883 0.07176537 0.02145331 0.06338287
    +#> 68 67 0.000000000 4.2046926        -Inf 0.06878636         NA         NA
    +#>        Power
    +#> 1         NA
    +#> 2  1.5397399
    +#> 3  1.1281356
    +#> 4  0.9404615
    +#> 5  0.8265616
    +#> 6  0.7478031
    +#> 7  0.6890567
    +#> 8  0.6430028
    +#> 9  0.6056046
    +#> 10 0.5744268
    +#> 11 0.5478999
    +#> 12 0.5249602
    +#> 13 0.5048576
    +#> 14 0.4870455
    +#> 15 0.4711148
    +#> 16 0.4567525
    +#> 17 0.4437140
    +#> 18 0.4318054
    +#> 19 0.4208706
    +#> 20 0.4107822
    +#> 21 0.4014349
    +#> 22 0.3927412
    +#> 23 0.3846275
    +#> 24 0.3770311
    +#> 25 0.3698987
    +#> 26 0.3631844
    +#> 27 0.3568482
    +#> 28 0.3508555
    +#> 29 0.3451761
    +#> 30 0.3397832
    +#> 31 0.3346531
    +#> 32 0.3297650
    +#> 33 0.3251001
    +#> 34 0.3206417
    +#> 35 0.3163749
    +#> 36 0.3122862
    +#> 37 0.3083632
    +#> 38 0.3045950
    +#> 39 0.3009716
    +#> 40 0.2974837
    +#> 41 0.2941231
    +#> 42 0.2908819
    +#> 43 0.2877534
    +#> 44 0.2847309
    +#> 45 0.2818086
    +#> 46 0.2789810
    +#> 47 0.2762429
    +#> 48 0.2735898
    +#> 49 0.2710172
    +#> 50 0.2685210
    +#> 51 0.2660977
    +#> 52 0.2637435
    +#> 53 0.2614553
    +#> 54 0.2592299
    +#> 55 0.2570646
    +#> 56 0.2549566
    +#> 57 0.2529034
    +#> 58 0.2509026
    +#> 59 0.2489521
    +#> 60 0.2470497
    +#> 61 0.2451934
    +#> 62 0.2433814
    +#> 63 0.2416120
    +#> 64 0.2398834
    +#> 65 0.2381941
    +#> 66 0.2365426
    +#> 67 0.2349276
    +#> 68        NA
    +#> 
    +#> $models
    +#> # A tibble: 4 × 6
    +#>   logLik    AIC    BIC model    Normal.Resid family     
    +#>    <dbl>  <dbl>  <dbl> <chr>    <chr>        <chr>      
    +#> 1   83.1 -160.  -154.  Exp      No           Exponential
    +#> 2   13.4  -20.8  -14.2 Power    No           PowerLaw   
    +#> 3  -27.5   61.0   67.5 LogExp   No           Exponential
    +#> 4  -80.8  168.   174.  LogPower No           PowerLaw   
    +#> 
    +#> $graph
    +#> Warning: Removed 20 row(s) containing missing values (geom_path).
    +
    +#> 
    +#> $params
    +#> # A tibble: 8 × 6
    +#>   term   estimate std.error statistic  p.value model   
    +#>   <chr>     <dbl>     <dbl>     <dbl>    <dbl> <chr>   
    +#> 1 c        2.25     0.384        5.84 1.87e- 7 LogPower
    +#> 2 Beta    -1.19     0.114      -10.4  1.90e-15 LogPower
    +#> 3 Beta    -0.449    0.0402     -11.2  1.13e-16 Power   
    +#> 4 c        1.54     0.150       10.3  3.63e-15 Power   
    +#> 5 c        0.673    0.0928       7.25 6.68e-10 LogExp  
    +#> 6 Lambda  -0.0684   0.00241    -28.4  5.33e-38 LogExp  
    +#> 7 Lambda  -0.0424   0.00157    -27.0  2.31e-37 Exp     
    +#> 8 c        0.164    0.0247       6.63 7.39e- 9 Exp     
    +#> 
    +
    +
    +
    +
    -
    - +
    + - - - + diff --git a/docs/reference/ExtinctionOrder.html b/docs/reference/ExtinctionOrder.html index c86e0f8..1362a69 100644 --- a/docs/reference/ExtinctionOrder.html +++ b/docs/reference/ExtinctionOrder.html @@ -1,193 +1,148 @@ - - - - - - +Extinctions analysis from custom order — ExtinctionOrder • NetworkExtinction + Skip to contents + -Extinctions analysis from custom order — ExtinctionOrder • NetworkExtinction +
    +
    +
    - - - +
    +

    This function takes a network and eliminates nodes using a custom order. Subsequently, secondary extinctions are tallied up. Secondary extinction severity can be targeted by manipulating the node-dependency on network edges (IS) and node-rewiring potential upon loss of links (Rewiring).

    +
    - - +
    +

    Usage

    +
    ExtinctionOrder(
    +  Network,
    +  Order,
    +  NetworkType = "Trophic",
    +  clust.method = "cluster_infomap",
    +  IS = 0,
    +  Rewiring = FALSE,
    +  RewiringDist,
    +  RewiringProb = 0.5,
    +  verbose = TRUE,
    +  RecalcConnect = FALSE
    +)
    +
    - - - +
    +

    Arguments

    +
    Network
    +

    a network representation as a an adjacency matrix, edgelist, or a network object

    - - - +
    Order
    +

    a numeric vector indexing order of primary extinctions. For Method = Mostconnected Order must be NULL. If Order is not NULL, Method is internally forced to be Ordered.

    +
    NetworkType
    +

    a character with the options Trophic and Mutualistic - is used to calculate secondary extinctions.

    - - - +
    clust.method
    +

    a character with the options cluster_edge_betweenness, cluster_spinglass, +cluster_label_prop or cluster_infomap, defaults to cluster_infomap

    +
    IS
    +

    either numeric or a named vector of numerics. Identifies the threshold of relative interaction strength which species require to not be considered secondarily extinct (i.e. IS = 0.3 leads to removal of all nodes which lose 70percent of their interaction strength in the Network argument). If a named vector, names must correspond to vertex names in Network argument.

    - - - - - - - - - - -
    -
    - - +
    RewiringDist
    +

    a numeric matrix of NxN dimension (N... number of nodes in Network). Contains, for example, phylogenetic or functional trait distances between nodes in Network which are used by the Rewiring argument to calculate rewiring probabilities.

    -
    -
    -
    - +
    RewiringProb
    +

    a numeric which identifies the threshold at which to assume rewiring potential is met.

    -
    -

    It takes a network, and extinguishes nodes using a custom order, -then it calculates the secondary extinctions and plots the accumulated -secondary extinctions.

    -
    -
    ExtinctionOrder(Network, Order)
    +
    verbose
    +

    Logical. Whether to report on function progress or not.

    -

    Arguments

    - - - - - - - - - - -
    Network

    a network of class network

    Order

    Vector with the order of extinctions by ID

    -

    Value

    +
    RecalcConnect
    +

    Logical. Whether to recalculate connectedness of each node following each round of extinction simulation and subsequently update extinction order with newly mostconnected nodes.

    -

    exports data frame with the characteristics of the network after every -extintion, and a graph with the mean and 95

    -

    Author

    +
    +
    +

    Value

    + +

    exports list containing a data frame with the characteristics of the network after every extinction and a network object containing the final network. The resulting data frame contains 11 columns that incorporate the topological index, the secondary extinctions, predation release, and total extinctions of the network in each primary extinction.

    +
    +
    +

    Details

    +

    When NetworkType = Trophic, secondary extinctions only occur for any predator, but not producers. If NetworkType = Mutualistic, secondary extinctions occur for all species in the network.

    +

    When clust.method = cluster_edge_betweenness computes the network modularity using cluster_edge_betweenness methods from igraph to detect communities +When clust.method = cluster_spinglass computes the network modularity using cluster_spinglass methods from igraph to detect communities, here the number of spins are equal to the network size +When clust.method = cluster_label_prop computes the network modularity using cluster_label_prop methods from igraph to detect communities +When clust.method = cluster_infomap computes the network modularity using cluster_infomap methods from igraph to detect communities, here the number of nb.trials are equal to the network size

    +
    +
    +

    Author

    Derek Corcoran <derek.corcoran.barrios@gmail.com>

    M. Isidora Ávila-Thieme <msavila@uc.cl>

    +

    Erik Kusch <erik.kusch@bio.au.dk>

    +
    -
    - -
    +
    -
    - +
    + - - - + diff --git a/docs/reference/ExtinctionPlot-1.png b/docs/reference/ExtinctionPlot-1.png index bb94c69..d4f47c5 100644 Binary files a/docs/reference/ExtinctionPlot-1.png and b/docs/reference/ExtinctionPlot-1.png differ diff --git a/docs/reference/ExtinctionPlot-2.png b/docs/reference/ExtinctionPlot-2.png index b6658cc..533075f 100644 Binary files a/docs/reference/ExtinctionPlot-2.png and b/docs/reference/ExtinctionPlot-2.png differ diff --git a/docs/reference/ExtinctionPlot.html b/docs/reference/ExtinctionPlot.html index 98c73a3..f72425d 100644 --- a/docs/reference/ExtinctionPlot.html +++ b/docs/reference/ExtinctionPlot.html @@ -1,206 +1,119 @@ - - - - - - - -Plots the extinctions history of a network — ExtinctionPlot • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Plots the extinctions history of a network — ExtinctionPlot • NetworkExtinction + Skip to contents + +
    +
    +
    -
    +

    It takes a NetworkTopology class object and plots the network index after every extinction

    -
    ExtinctionPlot(History, Variable = "AccSecExt")
    +
    +

    Usage

    +
    ExtinctionPlot(History, Variable = "AccSecExt")
    +
    -

    Arguments

    - - - - - - - - - - -
    History

    a NetworkTopology object obtained from the Mostconnected function -or the ExtinctionOrder function

    Variable

    the variable of the NetworkTopology object that you want as a y variable

    +
    +

    Arguments

    +
    History
    +

    a NetworkTopology object obtained from the Mostconnected function +or the ExtinctionOrder function

    -

    Value

    -

    A plot of number of extinctions in the x axis vs the choosen variable in the Y axis

    -

    See also

    +
    Variable
    +

    the variable of the NetworkTopology object that you want as a y variable

    -

    [NetworkExtintion::ExtinctionOrder()]

    -

    Author

    +
    +
    +

    Value

    + +

    A plot of number of extinctions in the x axis vs the choosen variable in the Y axis

    +
    +
    +

    See also

    +

    [NetworkExtintion::ExtinctionOrder()]

    +
    +
    +

    Author

    Derek Corcoran <derek.corcoran.barrios@gmail.com>

    M. Isidora Ávila-Thieme <msavila@uc.cl>

    +
    -

    Examples

    -
    # If you don't specify the y variable it will plot the secondary extinctions -# by default -data("net") -history <- SimulateExtinctions(Network = net, Method = "Mostconnected") -
    #> [1] 1 -#> [1] 2 -#> [1] 3 -#> [1] 4
    ExtinctionPlot(History = history) -
    # You can also specify the variable to be ploted in the y axis -ExtinctionPlot(History = history, Variable = "Link_density") -
    -
    - -
    +
    +

    Examples

    +
    # If you don't specify the y variable it will plot the secondary extinctions
    +# by default
    +data("net")
    +history <- SimulateExtinctions(Network = net, Method = "Mostconnected")
    +#> 
      |                                                                            
      |                                                                      |   0%
      |                                                                            
      |=======                                                               |  10%
      |                                                                            
      |==============                                                        |  20%
      |                                                                            
      |=====================                                                 |  30%
      |                                                                            
      |============================                                          |  40%
      |                                                                            
      |======================================================================| 100%
    +#> Warning: Your network become completely unconnected before all primary extinctions were simulated. This happened at extinction step 4 out of 10
    +ExtinctionPlot(History = history$sims)
    +#> Warning: Removed 1 row(s) containing missing values (geom_path).
    +
    +# You can also specify the variable to be ploted in the y axis
    +ExtinctionPlot(History = history$sims, Variable = "Link_density")
    +
    +
    +
    +
    -
    - +
    + - - - + diff --git a/docs/reference/Less_Connected.html b/docs/reference/Less_Connected.html index c08fe8c..7830d15 100644 --- a/docs/reference/Less_Connected.html +++ b/docs/reference/Less_Connected.html @@ -1,177 +1,85 @@ - - - - - - - -A sparsely connected foodweb — Less_Connected • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +A sparsely connected foodweb — Less_Connected • NetworkExtinction + Skip to contents + +
    +
    +
    -
    -

    A trophic network with 30 species and 47 trophic interactions. -This foodweb has a connectance of 0.03

    +
    +

    A network with 30 species and 47 interactions. +This network has a connectance of 0.03

    -
    Less_Connected
    - - -

    Format

    +
    +

    Usage

    +
    Less_Connected
    +
    +
    +

    Format

    a network

    -

    See also

    - - +
    +
    +

    See also

    + +
    -
    - -
    +
    -
    - +
    + - - - + diff --git a/docs/reference/More_Connected.html b/docs/reference/More_Connected.html index dbb6785..f3a8b33 100644 --- a/docs/reference/More_Connected.html +++ b/docs/reference/More_Connected.html @@ -1,177 +1,85 @@ - - - - - - - -A densely connected foodweb — More_Connected • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +A densely connected foodweb — More_Connected • NetworkExtinction + Skip to contents + +
    +
    +
    -
    +

    A trophic network with 30 species and 222 trophic interactions. This foodweb has a connectance of 0.3

    -
    More_Connected
    - - -

    Format

    +
    +

    Usage

    +
    More_Connected
    +
    +
    +

    Format

    a network

    -

    See also

    - - +
    +
    +

    See also

    + +
    -
    - -
    +
    -
    - +
    + - - - + diff --git a/docs/reference/RandomExtinctions.html b/docs/reference/RandomExtinctions.html index 9015226..b87eaa7 100644 --- a/docs/reference/RandomExtinctions.html +++ b/docs/reference/RandomExtinctions.html @@ -1,245 +1,188 @@ - - - - - - +Random extinction — RandomExtinctions • NetworkExtinction + Skip to contents + -Random extinction — RandomExtinctions • NetworkExtinction +
    +
    +
    - - - +
    +

    Generates a null model by generating random extinction histories and calculating the mean and standard deviation of the accumulated secondary extinctions developed by making n random extinction histories.

    +
    - - +
    +

    Usage

    +
    RandomExtinctions(
    +  Network,
    +  nsim = 10,
    +  Record = FALSE,
    +  plot = FALSE,
    +  SimNum = NULL,
    +  NetworkType = "Trophic",
    +  clust.method = "cluster_infomap",
    +  parallel = FALSE,
    +  ncores,
    +  IS = 0,
    +  Rewiring = FALSE,
    +  RewiringDist = NULL,
    +  RewiringProb = 0.5,
    +  verbose = TRUE
    +)
    +
    - - - +
    +

    Arguments

    +
    Network
    +

    a network representation as a an adjacency matrix, edgelist, +or a network object

    - - - +
    nsim
    +

    numeric, number of simulations

    +
    Record
    +

    logical, if TRUE, records every simulation and you can read the +raw results in the object FullSims

    - - - +
    plot
    +

    logical if TRUE, will add a graph to the results

    +
    SimNum
    +

    numeric, how many nodes to register for primary extinction. By default sets all of them.

    - - - - - - - - - - -
    -
    - - +
    clust.method
    +

    a character with the options cluster_edge_betweenness, cluster_spinglass, +cluster_label_prop or cluster_infomap, defaults to cluster_infomap

    -
    -
    -
    - +
    parallel
    +

    if TRUE, it will use parallel procesing, if FALSE (default) it will run +sequentially

    -
    -

    Generates a null model by generating random extinction histories and calculating -the mean and standard deviation of the accumulated secondary extinctions developed -by making n random extinction histories

    -
    -
    RandomExtinctions(
    -  Network,
    -  nsim = 10,
    -  parallel = FALSE,
    -  ncores,
    -  Record = F,
    -  plot = F
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Network

    a trophic network of class network

    nsim

    number of simulations

    parallel

    if TRUE, it will use parallel procesing, if FALSE (default) it will run -sequentially

    ncores

    number of cores to use if using parallel procesing

    Record

    logical, if TRUE, records every simulation and you can read the -raw results in the object FullSims

    plot

    logical if true, will add a graph to the results

    - -

    Value

    - -

    exports data frame with the characteristics of the network after every -extintion, and a graph with the mean and 95

    -

    Author

    +
    ncores
    +

    numeric, number of cores to use if using parallel procesing

    + + +
    IS
    +

    either numeric or a named vector of numerics. Identifies the threshold of relative interaction strength which species require to not be considered secondarily extinct (i.e. IS = 0.3 leads to removal of all nodes which lose 70 precent of their interaction strength in the Network argument). If a named vector, names must correspond to vertex names in Network argument.

    + + +
    Rewiring
    +

    either a function or a named vector of functions. Signifies how rewiring probabilities are calculated from the RewiringDist argument. If FALSE, no rewiring is carried out.

    + + +
    RewiringDist
    +

    a numeric matrix of NxN dimension (N... number of nodes in Network). Contains, for example, phylogenetic or functional trait distances between nodes in Network which are used by the Rewiring argument to calculate rewiring probabilities.

    + + +
    RewiringProb
    +

    a numeric which identifies the threshold at which to assume rewiring potential is met.

    + +
    verbose
    +

    Logical. Whether to report on function progress or not.

    + +
    +
    +

    Value

    + + +

    exports list containing a data frame with the characteristics of the network after every extinction, a network object containing the final network, and a graph with the mean and 95percent interval. The resulting data frame contains 11 columns that incorporate the topological index, the secondary extinctions, predation release, and total extinctions of the network in each primary extinction.

    +
    +
    +

    Details

    +

    When NetworkType = Trophic, secondary extinctions only occur for any predator, but not producers. If NetworkType = Mutualistic, secondary extinctions occur for all species in the network.

    +

    When clust.method = cluster_edge_betweenness computes the network modularity using cluster_edge_betweenness methods from igraph to detect communities +When clust.method = cluster_spinglass computes the network modularity using cluster_spinglass methods from igraph to detect communities, here the number of spins are equal to the network size +When clust.method = cluster_label_prop computes the network modularity using cluster_label_prop methods from igraph to detect communities +When clust.method = cluster_infomap computes the network modularity using cluster_infomap methods from igraph to detect communities, here the number of nb.trials are equal to the network size

    +
    +
    +

    Author

    Derek Corcoran <derek.corcoran.barrios@gmail.com>

    M. Isidora Ávila-Thieme <msavila@uc.cl>

    +

    Erik Kusch <erik.kusch@bio.au.dk>

    +
    -

    Examples

    -
    #first example -data("More_Connected") -RandomExtinctions(Network = More_Connected, nsim = 20) -
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> Simulation 1 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> Simulation 2 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> Simulation 3 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> 27
    #> Warning: Coercing LHS to a list
    #> Simulation 4 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> 27
    #> 28
    #> 29
    #> Simulation 5 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> Warning: Coercing LHS to a list
    #> Simulation 6 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> 27
    #> Warning: Coercing LHS to a list
    #> Simulation 7 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> Simulation 8 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> 27
    #> 28
    #> Simulation 9 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> Warning: Density is not well-defined for networks of order 0.
    #> 25
    #> Simulation 10 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> Warning: Coercing LHS to a list
    #> Simulation 11 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> Warning: Density is not well-defined for networks of order 0.
    #> 27
    #> Simulation 12 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> Warning: Coercing LHS to a list
    #> Simulation 13 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> Simulation 14 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> Warning: Density is not well-defined for networks of order 0.
    #> 27
    #> Simulation 15 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> Simulation 16 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> Warning: Coercing LHS to a list
    #> Simulation 17 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> 25
    #> 26
    #> 27
    #> 28
    #> 29
    #> Warning: Coercing LHS to a list
    #> Simulation 18 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> Simulation 19 of 20 ready
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> 6
    #> 7
    #> 8
    #> 9
    #> 10
    #> 11
    #> 12
    #> 13
    #> 14
    #> 15
    #> 16
    #> 17
    #> 18
    #> 19
    #> 20
    #> 21
    #> 22
    #> 23
    #> 24
    #> Simulation 20 of 20 ready
    #> # A tibble: 29 x 5 -#> NumExt AccSecExt_95CI AccSecExt_mean Upper Lower -#> <int> <dbl> <dbl> <dbl> <dbl> -#> 1 1 0.544 0.0769 0.621 0 -#> 2 2 1.09 0.154 1.24 0 -#> 3 3 1.72 0.462 2.18 0 -#> 4 4 2.14 0.769 2.91 0 -#> 5 5 3.26 1.46 4.72 0 -#> 6 6 3.10 2 5.10 0 -#> 7 7 3.54 2.54 6.08 0 -#> 8 8 3.88 2.62 6.50 0 -#> 9 9 4.56 3.08 7.64 0 -#> 10 10 4.77 3.38 8.15 0 -#> # … with 19 more rows
    -# Using parallel procesing -## Detect your number of cores divide by 2 -if (FALSE) { -cores <- ceiling(parallel::detectCores()/2) - -RandomExtinctions(Network = More_Connected, nsim = 20, parallel = TRUE, ncores = cores) -} - -
    -
    - -
    +
    +

    Examples

    +
    #first example
    +if (FALSE) {
    +data("More_Connected")
    +RandomExtinctions(Network = More_Connected, nsim = 20)
    +
    +# Using parallel procesing
    +## Detect your number of cores divide by 2
    +
    +cores <- ceiling(parallel::detectCores()/2)
    +
    +RandomExtinctions(Network = More_Connected, nsim = 20, parallel = TRUE, ncores = cores)
    +}
    +
    +
    +
    +
    -
    - +
    + - - - + diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png index 19cdd71..ae989c1 100644 Binary files a/docs/reference/Rplot002.png and b/docs/reference/Rplot002.png differ diff --git a/docs/reference/SimulateExtinctions.html b/docs/reference/SimulateExtinctions.html index 6ce0e17..ae61660 100644 --- a/docs/reference/SimulateExtinctions.html +++ b/docs/reference/SimulateExtinctions.html @@ -1,254 +1,378 @@ - - - - - - +Extinctions analysis for ecological networks — SimulateExtinctions • NetworkExtinction + Skip to contents + -Extinctions analysis for trophic networks — SimulateExtinctions • NetworkExtinction +
    +
    +
    - - - +
    +

    The SimulateExtinctions function, can be used to test how the order of species +extinctions, species-dependency on existing interaction strength, and rewiring potential might affect the stability of the network by comparing The extinction history +and checking for secondary extinctions.

    +
    - - +
    +

    Usage

    +
    SimulateExtinctions(
    +  Network,
    +  Method,
    +  Order = NULL,
    +  NetworkType = "Trophic",
    +  clust.method = "cluster_infomap",
    +  IS = 0,
    +  Rewiring = FALSE,
    +  RewiringDist,
    +  RewiringProb = 0.5,
    +  verbose = TRUE
    +)
    +
    - - - +
    +

    Arguments

    +
    Network
    +

    a network representation as a an adjacency matrix, edgelist, +or a network object

    - - - +
    Method
    +

    a character with the options Mostconnected and Ordered

    +
    Order
    +

    a numeric vector indexing order of primary extinctions. For Method = Mostconnected Order must be NULL. If Order is not NULL, Method is internally forced to be Ordered.

    - - - +
    NetworkType
    +

    a character with the options Trophic and Mutualistic - is used to calculate secondary extinctions.

    +
    clust.method
    +

    a character with the options cluster_edge_betweenness, cluster_spinglass, +cluster_label_prop or cluster_infomap, defaults to cluster_infomap

    - - - - - - - - - - -
    -
    - - +
    Rewiring
    +

    either a function or a named vector of functions. Signifies how rewiring probabilities are calculated from the RewiringDist argument. If FALSE, no rewiring is carried out.

    -
    -
    -
    - +
    RewiringDist
    +

    a numeric matrix of NxN dimension (N... number of nodes in Network). Contains, for example, phylogenetic or functional trait distances between nodes in Network which are used by the Rewiring argument to calculate rewiring probabilities.

    + + +
    RewiringProb
    +

    a numeric which identifies the threshold at which to assume rewiring potential is met.

    -
    -

    The SimulateExtinctions function, can be used to test how the order of species -extinctions might affect the stability of the network by comparing The extintion history -and checking for secondary extinctions.

    -
    -
    SimulateExtinctions(Network, Method, Order = NULL)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    Network

    a network representation as a an adyacency matrix, edgelist, -or a network object

    Method

    a character with the options Mostconnected, Oredered, or Random

    Order

    this should be NULL, unless using the Ordered method, in that case -it should be a vector with the order of extinctions by ID

    - -

    Value

    - -

    exports data frame with the characteristics of the network after every -extintion. The resulting data frame contains 11 columns that incorporate the -topological index, the secondary extinctions, predation release, and total extinctions of the network -in each primary extinction.

    -

    Details

    - -

    When method is Mostconnected, it takes a network and it calculates wich node is the most connected -of the network, using total degree. Then remove the most connected node, -and calculates the the topological indexes of the network and the number of -secundary extintions (how many species have indegree 0, without considered -primary producers). After that, remove the nodes that were secondarily extinct -in the previous step and recalculate which is the new most connected -node and so on, until the number of links in the network is zero.

    -

    When method is Ordered, it takes a network, and extinguishes nodes using a custom order, -then it calculates the secondary extinctions and plots the accumulated -secondary extinctions.

    -

    Author

    +
    verbose
    +

    Logical. Whether to report on function progress or not.

    +
    +
    +

    Value

    + + +

    exports list containing a data frame with the characteristics of the network after every extinction and a network object containing the final network. The resulting data frame contains 11 columns that incorporate the topological index, the secondary extinctions, predation release, and total extinctions of the network in each primary extinction.

    +
    +
    +

    Details

    +

    When method is Mostconnected, the function takes the network and calculates which node is the most connected of the network, using total degree. Then remove the most connected node, and calculates the the topological indexes of the network and the number of secondary extinctions. This process is repeated until the entire network has gone extinct.

    +

    When method is Ordered, it takes a network, and extinguishes nodes using a custom order, then it calculates the secondary extinctions and plots the accumulated secondary extinctions.

    +

    When NetworkType = Trophic, secondary extinctions only occur for any predator, but not producers. If NetworkType = Mutualistic, secondary extinctions occur for all species in the network.

    +

    When clust.method = cluster_edge_betweenness computes the network modularity using cluster_edge_betweenness methods from igraph to detect communities +When clust.method = cluster_spinglass computes the network modularity using cluster_spinglass methods from igraph to detect communities, here the number of spins are equal to the network size +When clust.method = cluster_label_prop computes the network modularity using cluster_label_prop methods from igraph to detect communities +When clust.method = cluster_infomap computes the network modularity using cluster_infomap methods from igraph to detect communities, here the number of nb.trials are equal to the network size

    +
    +
    +

    Author

    Derek Corcoran <derek.corcoran.barrios@gmail.com>

    M. Isidora Ávila-Thieme <msavila@uc.cl>

    +

    Erik Kusch <erik.kusch@bio.au.dk>

    +
    -

    Examples

    -
    # Mostconnected example -data("net") -SimulateExtinctions(Network = net, Method = "Mostconnected") -
    #> [1] 1 -#> [1] 2 -#> [1] 3 -#> [1] 4
    #> Spp S L C Link_density SecExt Pred_release Iso_nodes AccSecExt -#> 1 6 9 7 0.08641975 0.7777778 1 0 1 1 -#> 2 7 7 4 0.08163265 0.5714286 0 2 2 1 -#> 3 5 6 2 0.05555556 0.3333333 1 3 3 2 -#> 4 2 4 0 0.00000000 0.0000000 1 3 4 3 -#> NumExt TotalExt -#> 1 1 2 -#> 2 2 3 -#> 3 3 5 -#> 4 4 7
    #first Ordered example -data("net") -SimulateExtinctions(Network = net, Order = c(1,2,3,4,5,6,7,8,9,10), Method = "Ordered") -
    #> 1
    #> 2
    #> 3
    #> 4
    #> 5
    #> Spp S L C Link_density SecExt Pred_release Iso_nodes AccSecExt NumExt -#> 1 1 9 9 0.1111111 1.0000000 1 0 0 1 1 -#> 2 2 7 6 0.1224490 0.8571429 1 0 0 2 2 -#> 3 3 5 3 0.1200000 0.6000000 2 0 1 4 3 -#> 4 4 2 1 0.2500000 0.5000000 1 0 0 5 4 -#> 5 5 1 0 0.0000000 0.0000000 1 0 1 6 5 -#> TotalExt -#> 1 2 -#> 2 4 -#> 3 7 -#> 4 9 -#> 5 11
    #Second Ordered example -data("net") -SimulateExtinctions(Network = net, Order = c(2,8,9), Method = "Ordered") -
    #> 1
    #> 2
    #> 3
    #> Spp S L C Link_density SecExt Pred_release Iso_nodes AccSecExt -#> 1 2 9 8 0.09876543 0.8888889 1 0 0 1 -#> 2 8 7 4 0.08163265 0.5714286 1 1 1 2 -#> 3 9 6 4 0.11111111 0.6666667 0 1 0 2 -#> NumExt TotalExt -#> 1 1 2 -#> 2 2 4 -#> 3 3 5
    -
    - -
    +
    +

    Examples

    +
    # Mostconnected example
    +data("net")
    +SimulateExtinctions(Network = net, Method = "Mostconnected",
    +clust.method = "cluster_infomap")
    +#> 
      |                                                                            
      |                                                                      |   0%
      |                                                                            
      |=======                                                               |  10%
      |                                                                            
      |==============                                                        |  20%
      |                                                                            
      |=====================                                                 |  30%
      |                                                                            
      |============================                                          |  40%
      |                                                                            
      |======================================================================| 100%
    +#> Warning: Your network become completely unconnected before all primary extinctions were simulated. This happened at extinction step 4 out of 10
    +#> $sims
    +#>   Spp S L          C Link_density Modularity SecExt Pred_release Iso_nodes
    +#> 1   6 9 7 0.08641975    0.7777778  0.3163265      1            0         1
    +#> 2   7 7 4 0.08163265    0.5714286  0.0000000      0            2         2
    +#> 3   5 6 2 0.05555556    0.3333333  0.0000000      1            3         3
    +#> 4   2 4 0 0.00000000    0.0000000        NaN      1            3         4
    +#> 5   1 2 0 0.00000000    0.0000000         NA     NA           NA        NA
    +#>   AccSecExt NumExt TotalExt
    +#> 1         1      1        2
    +#> 2         1      2        3
    +#> 3         2      3        5
    +#> 4         3      4        7
    +#> 5        NA      5       NA
    +#> 
    +#> $Network
    +#>  Network attributes:
    +#>   vertices = 2 
    +#>   directed = TRUE 
    +#>   hyper = FALSE 
    +#>   loops = TRUE 
    +#>   multiple = FALSE 
    +#>   bipartite = FALSE 
    +#>   total edges= 0 
    +#>     missing edges= 0 
    +#>     non-missing edges= 0 
    +#> 
    +#>  Vertex attribute names: 
    +#>     vertex.names 
    +#> 
    +#> No edge attributes
    +#> 
    +
    +#first Ordered example
    +data("net")
    +SimulateExtinctions(Network = net, Order = c(1,2,3,4,5,6,7,8,9,10),
    +Method = "Ordered" , clust.method = "cluster_infomap")
    +#> 
      |                                                                            
      |                                                                      |   0%
      |                                                                            
      |=======                                                               |  10%
      |                                                                            
      |==============                                                        |  20%
      |                                                                            
      |=====================                                                 |  30%
      |                                                                            
      |============================                                          |  40%
      |                                                                            
      |===================================                                   |  50%
    +#> Warning: Density is not well-defined for networks of order 0.
    +#> 
      |                                                                            
      |======================================================================| 100%
    +#> Warning: Your network become completely unconnected before all primary extinctions were simulated. This happened at extinction step 5 out of 10
    +#> $sims
    +#>   Spp S L         C Link_density Modularity SecExt Pred_release Iso_nodes
    +#> 1   1 9 9 0.1111111    1.0000000  0.2901235      1            0         0
    +#> 2   2 7 6 0.1224490    0.8571429  0.0000000      1            0         0
    +#> 3   3 5 3 0.1200000    0.6000000  0.0000000      2            0         1
    +#> 4   4 2 1 0.2500000    0.5000000  0.0000000      1            0         0
    +#> 5   5 1 0 0.0000000    0.0000000        NaN      1            0         1
    +#> 6   6 0 0       NaN          NaN         NA     NA           NA        NA
    +#>   AccSecExt NumExt TotalExt
    +#> 1         1      1        2
    +#> 2         2      2        4
    +#> 3         4      3        7
    +#> 4         5      4        9
    +#> 5         6      5       11
    +#> 6        NA      6       NA
    +#> 
    +#> $Network
    +#>  Network attributes:
    +#>   vertices = 0 
    +#>   directed = TRUE 
    +#>   hyper = FALSE 
    +#>   loops = TRUE 
    +#>   multiple = FALSE 
    +#>   bipartite = FALSE 
    +#>   total edges= 0 
    +#>     missing edges= 0 
    +#>     non-missing edges= 0 
    +#> 
    +#> No vertex attributes
    +#> 
    +#> No edge attributes
    +#> 
    +
    + #Second Ordered example
    +data("net")
    +SimulateExtinctions(Network = net, Order = c(2,8,9),
    +Method = "Ordered", clust.method = "cluster_infomap")
    +#> 
      |                                                                            
      |                                                                      |   0%
      |                                                                            
      |=======================                                               |  33%
      |                                                                            
      |===============================================                       |  67%
      |                                                                            
      |======================================================================| 100%
    +#> $sims
    +#>   Spp S L          C Link_density Modularity SecExt Pred_release Iso_nodes
    +#> 1   2 9 8 0.09876543    0.8888889  0.3671875      1            0         0
    +#> 2   8 7 4 0.08163265    0.5714286  0.3750000      1            0         1
    +#> 3   9 6 4 0.11111111    0.6666667  0.3750000      0            0         0
    +#>   AccSecExt NumExt TotalExt
    +#> 1         1      1        2
    +#> 2         2      2        4
    +#> 3         2      3        5
    +#> 
    +#> $Network
    +#>  Network attributes:
    +#>   vertices = 6 
    +#>   directed = TRUE 
    +#>   hyper = FALSE 
    +#>   loops = TRUE 
    +#>   multiple = FALSE 
    +#>   bipartite = FALSE 
    +#>   total edges= 4 
    +#>     missing edges= 0 
    +#>     non-missing edges= 4 
    +#> 
    +#>  Vertex attribute names: 
    +#>     vertex.names 
    +#> 
    +#>  Edge attribute names: 
    +#>     weight 
    +#> 
    +
    +#Network-Dependency Example
    +data("net")
    +SimulateExtinctions(Network = net, Order = c(2,8), IS = 0.3,
    +Method = "Ordered", clust.method = "cluster_infomap")
    +#> 
      |                                                                            
      |                                                                      |   0%
      |                                                                            
      |===================================                                   |  50%
      |                                                                            
      |======================================================================| 100%
    +#> $sims
    +#>   Spp S L          C Link_density Modularity SecExt Pred_release Iso_nodes
    +#> 1   2 9 8 0.09876543    0.8888889  0.3671875      1            1         0
    +#> 2   8 7 4 0.08163265    0.5714286  0.3750000      1            0         1
    +#>   AccSecExt NumExt TotalExt
    +#> 1         1      1        2
    +#> 2         2      2        4
    +#> 
    +#> $Network
    +#>  Network attributes:
    +#>   vertices = 6 
    +#>   directed = TRUE 
    +#>   hyper = FALSE 
    +#>   loops = TRUE 
    +#>   multiple = FALSE 
    +#>   bipartite = FALSE 
    +#>   total edges= 4 
    +#>     missing edges= 0 
    +#>     non-missing edges= 4 
    +#> 
    +#>  Vertex attribute names: 
    +#>     vertex.names 
    +#> 
    +#>  Edge attribute names: 
    +#>     weight 
    +#> 
    +
    + #Rewiring
    +data("net")
    +data(dist)
    +SimulateExtinctions(Network = net, Order = c(2,8), IS = 0.3,
    +# assuming an exponential decline in rewiring potential
    +# as values in RewiringDist increase
    +Rewiring = function(x){1-pexp(x, rate = 1/0.5)},
    +RewiringDist = dist, # distance matrix
    +RewiringProb = 0.2, # low threshold for rewiring potential
    +Method = "Ordered", clust.method = "cluster_infomap")
    +#> 
      |                                                                            
      |                                                                      |   0%
      |                                                                            
      |===================================                                   |  50%
      |                                                                            
      |======================================================================| 100%
    +#> $sims
    +#>   Spp S L          C Link_density Modularity SecExt Pred_release Iso_nodes
    +#> 1   2 9 8 0.09876543    0.8888889  0.3671875      0            0         0
    +#> 2   8 8 6 0.10714286    0.7500000  0.2777778      0            0         0
    +#>   AccSecExt NumExt TotalExt
    +#> 1         0      1        1
    +#> 2         0      2        2
    +#> 
    +#> $Network
    +#>  Network attributes:
    +#>   vertices = 8 
    +#>   directed = TRUE 
    +#>   hyper = FALSE 
    +#>   loops = FALSE 
    +#>   multiple = FALSE 
    +#>   bipartite = FALSE 
    +#>   total edges= 9 
    +#>     missing edges= 0 
    +#>     non-missing edges= 9 
    +#> 
    +#>  Vertex attribute names: 
    +#>     vertex.names 
    +#> 
    +#>  Edge attribute names: 
    +#>     weight 
    +#> 
    +
    +#Rewiring, assuming dist contains probabilities
    +#' data("net")
    +data(dist)
    +SimulateExtinctions(Network = net, Order = c(2,8), IS = 0.3,
    +Rewiring = function(x){x}, # no changes to the RewiringDist object means
    +RewiringDist = dist, RewiringProb = 0.2,
    +Method = "Ordered", clust.method = "cluster_infomap")
    +#> 
      |                                                                            
      |                                                                      |   0%
      |                                                                            
      |===================================                                   |  50%
      |                                                                            
      |======================================================================| 100%
    +#> $sims
    +#>   Spp S L          C Link_density Modularity SecExt Pred_release Iso_nodes
    +#> 1   2 9 8 0.09876543    0.8888889  0.3671875      0            0         0
    +#> 2   8 8 7 0.12500000    0.8750000  0.3571429      0            0         0
    +#>   AccSecExt NumExt TotalExt
    +#> 1         0      1        1
    +#> 2         0      2        2
    +#> 
    +#> $Network
    +#>  Network attributes:
    +#>   vertices = 8 
    +#>   directed = TRUE 
    +#>   hyper = FALSE 
    +#>   loops = FALSE 
    +#>   multiple = FALSE 
    +#>   bipartite = FALSE 
    +#>   total edges= 8 
    +#>     missing edges= 0 
    +#>     non-missing edges= 8 
    +#> 
    +#>  Vertex attribute names: 
    +#>     vertex.names 
    +#> 
    +#>  Edge attribute names: 
    +#>     weight 
    +#> 
    +
    +
    +
    - + - - - + diff --git a/docs/reference/chilean_intertidal.html b/docs/reference/chilean_intertidal.html index 0591080..66aff2c 100644 --- a/docs/reference/chilean_intertidal.html +++ b/docs/reference/chilean_intertidal.html @@ -1,177 +1,85 @@ - - - - - - - -The foodweb of the intertidal zone in central chile — chilean_intertidal • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +The binaryfoodweb of the intertidal zone in central chile — chilean_intertidal • NetworkExtinction + Skip to contents + +
    +
    +
    -
    +

    A trophic network with 107 species present in the intertidal zone of central Chile. The food web was reconstructed from the Kefi et al. 2015

    -
    chilean_intertidal
    - - -

    Format

    +
    +

    Usage

    +
    chilean_intertidal
    +
    +
    +

    Format

    a network

    -

    References

    - +
    +
    +

    References

    Kefi, Sonia, Eric L. Berlow, Evie A. Wieters, Lucas N. Joppa, Spencer A. Wood, Ulrich Brose, and Sergio A. Navarrete. "Network structure beyond food webs: mapping non trophic and trophic interactions on Chilean rocky shores." Ecology 96, no. 1 (2015.

    +
    -
    - -
    +
    - + - - - + diff --git a/docs/reference/figures/README-unnamed-chunk-10-1.png b/docs/reference/figures/README-unnamed-chunk-10-1.png index a532fe5..a1f0001 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-10-1.png and b/docs/reference/figures/README-unnamed-chunk-10-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-11-1.png b/docs/reference/figures/README-unnamed-chunk-11-1.png index 5cd0e95..6c96e42 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-11-1.png and b/docs/reference/figures/README-unnamed-chunk-11-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-12-1.png b/docs/reference/figures/README-unnamed-chunk-12-1.png index 458d76f..b3037bd 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-12-1.png and b/docs/reference/figures/README-unnamed-chunk-12-1.png differ diff --git a/docs/reference/figures/README-unnamed-chunk-15-1.png b/docs/reference/figures/README-unnamed-chunk-15-1.png index cf27527..c78a8da 100644 Binary files a/docs/reference/figures/README-unnamed-chunk-15-1.png and b/docs/reference/figures/README-unnamed-chunk-15-1.png differ diff --git a/docs/reference/index.html b/docs/reference/index.html index b4a4910..9c3289d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,260 +1,138 @@ - - - - - - - -Function reference • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function reference • NetworkExtinction - + + Skip to contents + +
    -
    - - - -
    - -
    - +
    + + + -
    + + - - - + diff --git a/docs/reference/net.html b/docs/reference/net.html index 1bacb48..b989263 100644 --- a/docs/reference/net.html +++ b/docs/reference/net.html @@ -1,172 +1,78 @@ - - - - - - - -A toymodel trophic network — net • NetworkExtinction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +A toymodel trophic network — net • NetworkExtinction + Skip to contents + +
    +
    +
    -
    +

    A trophic network with 10 species where the first four species are primery producters

    -
    net
    - - -

    Format

    +
    +

    Usage

    +
    net
    +
    +
    +

    Format

    a network

    +
    -
    - -
    +
    - + - - - + diff --git a/man/CompareExtinctions.Rd b/man/CompareExtinctions.Rd index 4444131..2efd12c 100644 --- a/man/CompareExtinctions.Rd +++ b/man/CompareExtinctions.Rd @@ -22,11 +22,13 @@ with a null hypothesis generated by the RandomExtinctions function it is importa RandomExtinctions is in plot = T. } \examples{ +\dontrun{ data("Less_Connected") History <- SimulateExtinctions(Network = Less_Connected, Method = "Mostconnected") NullHyp <- RandomExtinctions(Network = Less_Connected, nsim = 100) CompareExtinctions(Nullmodel = NullHyp, Hypothesis = History) } +} \author{ Derek Corcoran diff --git a/man/RandomExtinctions.Rd b/man/RandomExtinctions.Rd index cba875c..54cee30 100644 --- a/man/RandomExtinctions.Rd +++ b/man/RandomExtinctions.Rd @@ -70,12 +70,13 @@ When clust.method = cluster_infomap computes the network modularity using cluste } \examples{ #first example +\dontrun{ data("More_Connected") RandomExtinctions(Network = More_Connected, nsim = 20) # Using parallel procesing ## Detect your number of cores divide by 2 -\dontrun{ + cores <- ceiling(parallel::detectCores()/2) RandomExtinctions(Network = More_Connected, nsim = 20, parallel = TRUE, ncores = cores) diff --git a/vignettes/vignettes/figuresmostconnected3-1.png b/vignettes/vignettes/figuresmostconnected3-1.png index e8556a9..09aafe1 100644 Binary files a/vignettes/vignettes/figuresmostconnected3-1.png and b/vignettes/vignettes/figuresmostconnected3-1.png differ diff --git a/vignettes/vignettes/figuresunnamed-chunk-10-1.png b/vignettes/vignettes/figuresunnamed-chunk-10-1.png index c495cfc..54983b0 100644 Binary files a/vignettes/vignettes/figuresunnamed-chunk-10-1.png and b/vignettes/vignettes/figuresunnamed-chunk-10-1.png differ diff --git a/vignettes/vignettes/figuresunnamed-chunk-12-1.png b/vignettes/vignettes/figuresunnamed-chunk-12-1.png index 50de5da..9a245fb 100644 Binary files a/vignettes/vignettes/figuresunnamed-chunk-12-1.png and b/vignettes/vignettes/figuresunnamed-chunk-12-1.png differ diff --git a/vignettes/vignettes/figuresunnamed-chunk-13-1.png b/vignettes/vignettes/figuresunnamed-chunk-13-1.png index 12b3e70..8b2d2bb 100644 Binary files a/vignettes/vignettes/figuresunnamed-chunk-13-1.png and b/vignettes/vignettes/figuresunnamed-chunk-13-1.png differ diff --git a/vignettes/vignettes/figuresunnamed-chunk-14-1.png b/vignettes/vignettes/figuresunnamed-chunk-14-1.png index 99eebc5..12012b4 100644 Binary files a/vignettes/vignettes/figuresunnamed-chunk-14-1.png and b/vignettes/vignettes/figuresunnamed-chunk-14-1.png differ diff --git a/vignettes/vignettes/figuresunnamed-chunk-17-1.png b/vignettes/vignettes/figuresunnamed-chunk-17-1.png index 51d2d49..80cccb5 100644 Binary files a/vignettes/vignettes/figuresunnamed-chunk-17-1.png and b/vignettes/vignettes/figuresunnamed-chunk-17-1.png differ diff --git a/vignettes/vignettes/figuresunnamed-chunk-7-1.png b/vignettes/vignettes/figuresunnamed-chunk-7-1.png index 12b3e70..8b2d2bb 100644 Binary files a/vignettes/vignettes/figuresunnamed-chunk-7-1.png and b/vignettes/vignettes/figuresunnamed-chunk-7-1.png differ