knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.width=5, fig.height=5) library(geneplot)
library(knitr) opts_knit$set(global.par = TRUE) ## Set package option for knitr -- this is NOT the same as changing the chunk options like we did above with opts_chunk$set
par(mar=c(3,3,0.75,0.75),mgp=c(2,0.7,0)) # set narrower plot margins (must be in a separate chunk to the calls to plot, because of the way the global.par option works in knitr)
This is a vignette describing how to convert Genepop-format files into the format required by geneplot
.
Here is an example of code that would import a file in Genepop format, using 3 digits per allele and specifying the population names using the pop_names input. After importing the Genepop-format data, the data and the names of the loci must be passed separately into the geneplot
function.
genepopData <- read_genepop_format(file="C:/Users/me/Documents/myfile.gen", digits_per_allele=3, pop_names=c("PopA","PopB","PopC"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.