get_stats_gg: Prepare bootstrapped results for 'ggplot' friendly data...

View source: R/ggplot_functions.r

get_stats_ggR Documentation

Prepare bootstrapped results for ggplot friendly data format.

Description

Helper function to convert the bootstrapped dissimilarities from matrix format to ggplot2 friendly data format.

Usage

get_stats_gg(x, probs = c(0.025, 0.975))

Arguments

x

A matrix of bootstrapped dissimilarities from boot_dissim

probs

A numeric vector of two probabilities in the interval [0, 1]. Used for building the lower and upper bounds of the confidence intervals. Defaults to c(0.025, 0.975), which corresponds to a 95\% confidence interval.

Value

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/number of sampled interactions (spl_size) at each step and the corresponding mean dissimilarity (mean) together with its bootstrap confidence interval limits (ci_low, ci_up). The second one, lines_df, contains all the bootstrapped dissimilarities (value) at each bootstrap iteration (simulation_id) and its corresponding sample size/sampled interactions (spl_size). Can be used for enhancing visual effect when plotting the mean bootstrap values.


valentinitnelav/bootdissim documentation built on Oct. 11, 2022, 12:34 a.m.