get_stats_single | R Documentation |
ggplot
friendly data
format.Helper to prepare the bootstrapped metric output of a single web/network
from boot_networklevel_n
or
boot_specieslevel_n
in a format ready for
ggplot
.
get_stats_single(x, probs = c(0.025, 0.975))
x |
A bootstrap matrix or an array of matrices from
|
probs |
A numeric vector of two probabilities in |
A list of two data frames to be used with ggplot
.
First one, stats_df
is a 4 columns data frame, containing the sample size
(spl_size
) at each iteration and the corresponding mean metric (mean
)
together with its bootstrap confidence interval limits (ci_low
, ci_up
).
The second one, lines_df
, contains all the bootstrapped values (value
) of
a given network metric at each iteration (simulation_id
) and its
corresponding sample size (spl_size
). Can be used for enhancing visual
effect when plotting the mean bootstrap values.
library(bootstrapnet)
library(bipartite)
library(magrittr)
data(Safariland)
stats_d_lower <- Safariland %>%
web_matrix_to_df() %>%
boot_specieslevel_n(col_lower = "lower", # column name for plants
col_higher = "higher", # column name for insects
index = "d",
level = "both",
start = 100,
step = 100,
n_boot = 10,
n_cpu = 2) %>%
.[["lower_level"]] %>%
get_stats_single()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.