knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "inst/vignette-supp/", tidy = TRUE )
Construct a barplot for your STRUCTURE/ADMIXTURE output using starmie
in a few
lines of code!
# install.packages("starmie") library(starmie) str_output <- system.file("extdata/microsat_testfiles/", "locprior_K5.out_f", package = "starmie") k5_data <- loadStructure(str_output) k5_data plotBar(k5_data, facet = FALSE)
intro_rmd <- 'vignettes/using-starmie.Rmd' raw_rmd <- readLines(intro_rmd) # remove yaml yaml_lines <- grep("---", raw_rmd) # remove appendix (session info) appendix <- grep("Appendix", raw_rmd) compressed_rmd <- raw_rmd[c(-seq(yaml_lines[1], yaml_lines[2], by = 1), -seq(appendix, length(raw_rmd)))] writeLines(compressed_rmd, "child.Rmd")
starmie
is available as an R package on CRAN
install.packages("starmie")
The development version of starmie
can be installed with devtools
install.packages("devtools") devtools::install_github("sa-lee/starmie")
If you would like to also build the vignette with your installation run:
devtools::install_github("sa-lee/starmie", build_vignettes = TRUE)
if (file.exists("child.Rmd")) { file.remove("child.Rmd") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.