##this file is used to update the README.md from the package vignette

##(credit for the idea and implementation in this packages goes to Thibuat Jombart)

##to update README.md, simply run:

##knitr::knit("README.Rmd")
##delete old figures

file.remove(dir("vignettes/figure",full.names = T))

## recompile vignette

setwd("vignettes")

knitr::knit("mtDNAcombine.Rmd")

setwd("../")
## read md of the vignette

mdInput <- readLines("vignettes/mtDNAcombine.md")



## remove vignette-specific headers

toRemove <- 1:12

mdInput <- mdInput[-toRemove]


## add badges 

circleci_img <- '[![CircleCI](https://img.shields.io/circleci/build/github/EvolEcolGroup/mtDNAcombine/master?label=build%20%28master%29&logo=circleci&style=plastic&token=dbf19e075582baa257024cdbe7a75edf96f93517)](https://circleci.com/gh/EvolEcolGroup/mtDNAcombine/tree/master)'
## Add badge for Circleci 
mdInput[2] <- paste(circleci_img)


## restore right path for figures

## pick wd path depending on operating system
## LINUX
#foo <- '/home/eleanor/'
## Windows
foo <- 'C:/Users/mille/'

mdInput <- gsub(paste0(foo,"Documents/Projects/mtDNAcombine/inst/extdata/mtDNAcombine_flow.png"), "./inst/extdata/mtDNAcombine_flow.png", mdInput)
mdInput <- gsub(paste0(foo,"Documents/Projects/mtDNAcombine/inst/extdata/hist_Pinicola_enucleator.png"), "./inst/extdata/hist_Pinicola_enucleator.png", mdInput)
mdInput <- gsub(paste0(foo,"Documents/Projects/mtDNAcombine/inst/extdata/hist_Calidris_maritima.png"), "./inst/extdata/hist_Calidris_maritima.png", mdInput)
mdInput <- gsub(paste0(foo,"Documents/Projects/mtDNAcombine/inst/extdata/Net_Picoides_tridactylus.png"), "./inst/extdata/Net_Picoides_tridactylus.png", mdInput)
mdInput <- gsub("figure/plotting median-1.png", "./inst/extdata/common_rosefinch_BSP.png", mdInput)

cat(paste(mdInput,collapse="\n"))


EvolEcolGroup/mtDNAcombine documentation built on July 8, 2021, 10:30 p.m.