---
output:
  html_document:
    toc: true
    theme: united
  knitrBootstrap::bootstrap_document:
    theme.chooser: TRUE
    highlight.chooser: TRUE
---

<!--
%\VignetteEngine{knitr::rmarkdown}
%\VignetteIndexEntry{Introduction to derfinderPlot}
-->

Introduction to `derfinderPlot`
===============================

```{r vignetteSetup, echo=FALSE, message=FALSE, warning=FALSE}
## Track time spent on making the vignette
startTime <- Sys.time()

## Bib setup
library('knitcitations')

## Load knitcitations with a clean bibliography
cleanbib()
cite_options(hyperlink = 'to.doc', citation_format = 'text', style = 'html')
# Note links won't show for now due to the following issue
# https://github.com/cboettig/knitcitations/issues/63

## Write bibliography information
write.bibtex(c(
    knitcitations = citation('knitcitations'),
    derfinderPlot = citation('derfinderPlot')[1], 
    knitrBootstrap = citation('knitrBootstrap'), 
    knitr = citation('knitr')[3],
    rmarkdown = citation('rmarkdown')),
    file = 'derfinderPlotRef.bib')
bib <- read.bibtex('derfinderPlotRef.bib')

## Assign short names
names(bib) <- c('knitcitations', 'derfinderPlot', 'knitrBootstrap',
    'knitr', 'rmarkdown')
```


# Overview

This is a stub vignette. The real one can be viewed online [here](http://lcolladotor.github.io/derfinderPlot/).

```{r}
library('derfinderData')
```




# Reproducibility

Code for creating the vignette

```{r createVignette, eval=FALSE, bootstrap.show.code=FALSE}
## Create the vignette
library('knitrBootstrap') 

knitrBootstrapFlag <- packageVersion('knitrBootstrap') < '1.0.0'
if(knitrBootstrapFlag) {
    ## CRAN version
    library('knitrBootstrap')
    system.time(knit_bootstrap('derfinderPlot.Rmd', chooser=c('boot', 'code'), show_code = TRUE))
    unlink('derfinderPlot.md')
} else {
    ## GitHub version
    library('rmarkdown')
    system.time(render('derfinderPlot.Rmd', 'knitrBootstrap::bootstrap_document'))
}
## Note: if you prefer the knitr version use:
# library('rmarkdown')
# system.time(render('derfinderPlot.Rmd', 'html_document'))

## Extract the R code
library('knitr')
knit('derfinderPlot.Rmd', tangle = TRUE)
```

Date the vignette was generated.

```{r reproducibility1, echo=FALSE, bootstrap.show.code=FALSE}
## Date the vignette was generated
Sys.time()
```

Wallclock time spent generating the vignette.

```{r reproducibility2, echo=FALSE, bootstrap.show.code=FALSE}
## Processing time in seconds
totalTime <- diff(c(startTime, Sys.time()))
round(totalTime, digits=3)
```

`R` session information.

```{r reproducibility3, echo=FALSE, bootstrap.show.code=FALSE, bootstrap.show.message=FALSE}
## Session info
library('devtools')
session_info()
```

# Bibliography

This vignette was generated using `knitrBootstrap` `r citep(bib[['knitrBootstrap']])`
with `knitr` `r citep(bib[['knitr']])` and `rmarkdown` `r citep(bib[['rmarkdown']])` running behind the scenes.

Citations made with `knitcitations` `r citep(bib[['knitcitations']])`.

```{r vignetteBiblio, results='asis', echo=FALSE}
## Print bibliography
bibliography()
```
