compare_all_old <- function()
{
clean_pairmatrix <- function(cumbersome_df)
{
cumbersome_df$pairmatrix <- sapply(cumbersome_df$pairmatrix, as.vector)
return(tidyr::unnest(cumbersome_df))
}
data_recomb$pairmatrix_dump_data <- clean_pairmatrix(data_recomb$pairmatrix_dump_data)
data_no_recomb$pairmatrix_dump_data <- clean_pairmatrix(data_no_recomb$pairmatrix_dump_data)
# TODO: check if nrows > 0
p <- ggplot2::ggplot()
p <- p + ggplot2::geom_point(data=data_no_recomb$pairmatrix_dump_data,
ggplot2::aes(x=time, y=pairmatrix),
alpha = 0.05,
color="#FF6666")
p <- p + ggplot2::geom_line(data=data_no_recomb$summary_dump_data,
ggplot2::aes(x=time, y=med_pair_dist),
color="#660000")
p <- p + ggplot2::geom_point(data=data_recomb$pairmatrix_dump_data,
ggplot2::aes(x=time, y=pairmatrix),
alpha = 0.05,
color="#99CCFF")
p <- p + ggplot2::geom_line(data=data_recomb$summary_dump_data,
ggplot2::aes(x=time, y=med_pair_dist),
color="#000033")
p <- p + ggplot2::labs(x = paste("Time (in years)"),
y = paste("Sequence distances"),
title = paste0("Median pairwise distances\n",
"Red - without recombination, Blue - with recombination"))
print(p)
ggplot2::ggsave(paste0(save_file, "_pairwise_median_dist.png"), scale = 3)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.