knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of adrift
is to have an improved admixturegraph
package with better visualisation of graphs and graph statistics.
You can install the released version of adrift from CRAN with:
install.packages("adrift")
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("mailund/adrift")
library(magrittr) library(adrift) graph <- parse_dot(readr::read_file("data-raw/Basic_OngeEA_wArch.dot")) graph %>% make_graph_plot() %>% show_leaf_labels(nudge_y = -0.5) %>% show_inner_node_labels()
library(magrittr) library(adrift) graph <- parse_qpgraph(readr::read_file("data-raw/Basic_OngeEA_wArch.graph")) graph %>% make_graph_plot(edge_colour = "darkblue") %>% show_leaf_labels(nudge_y = -0.5, angle = 15) %>% show_inner_node_labels()
graph <- parse_dot(readr::read_file("data-raw/BosGraph.dot")) graph %>% make_graph_plot(edge_colour = "red") %>% show_leaf_labels(angle = -90, size = 2.8, nudge_y = -1, hjust = 0)
graph <- parse_qpgraph(readr::read_file("data-raw/Basic_OngeEA_wArch.graph")) plt <- graph %>% make_graph_plot( ggplot2::aes(filter = !admixed), edge_colour = "darkblue" ) %>% show_leaf_labels(nudge_y = -0.5, angle = 15) admixture_vars <- c( "P_P2" = "alpha", "K_K2" = "beta", "AfrAnc_AdmixedNonAfr" = "gamma", "SuperArch_DenisovaAncAnc" = "delta" ) plt %>% add_admixture_labels( admixture_vars, linetype = "dotted", colour = "darkred" ) plt %>% add_admixture_labels( attr(graph, "admixture_proportions"), label_size = 3, linetype = "dashed", colour = "darkgray" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.