densityPlot: Generate denisty plot for some matrix statistic

Description Usage Arguments Value Examples

Description

Generate denisty plot for some matrix statistic

Usage

1
densityPlot(mcmc_stats, variable, xlab)

Arguments

mcmc_stats

list of outputs from MeanMatrixStatistics

variable

variable to be ploted, any column in the mcmc_stats objects

xlab

x axis label

Value

ggplot2 density plot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
data(P_stats)
library(ggplot2)
library(cowplot)
r2_plot = densityPlot(P_stats, "MeanSquaredCorrelation",
                      "Mean squared correlation")
pc1.percent_plot = densityPlot(P_stats, "pc1.percent",
                               "Proportion of variation in E1") +
                     theme(legend.position = "none")
flexibility_plot = densityPlot(P_stats, "flexibility",
                               "Mean flexibility") +
                     theme(legend.position = "none")
evolvability_plot = densityPlot(P_stats, "evolvability",
                                "Mean evolvability") +
                      theme(legend.position = "none")
cond_evolvability_plot = densityPlot(P_stats, "conditional.evolvability",
                                     "Mean conditional evolvability") +
                           theme(legend.position = "none")
figure_3 <- ggdraw() +
    draw_plot(r2_plot, 0, 0.5, 0.5, 0.5) +
    draw_plot(pc1.percent_plot, 0.5, 0.5, 0.5, 0.5) +
    draw_plot(flexibility_plot, 0, 0, 0.5, 0.5) +
    draw_plot(evolvability_plot, 0.5, 0, 0.5, 0.5) +
    draw_plot_label(c("A", "B", "C", "D"), c(0, 0.5, 0, 0.5),
                    c(1, 1, 0.5, 0.5), size = 20)

diogro/ratones documentation built on May 24, 2019, 4:01 a.m.