knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Analysis is the third and final workflow of the Yolo Bypass Telemetry project. It begins after the database has been appended with new (formatted) detections and you are ready to generate the annual reproducible Telemetry Report.
inst/setup.R
script of the ybt
package source files)ybt
packageBy running:
devtools::install_github("fishsciences/ybt", build_vignettes = TRUE)
This will install all dependencies of the package as well.
First, download the YBT_Reports
repository. Open with Rstudio.
Save a new copy of Reports/AnnualTelemetrySummary.Rmd
- I suggest saving it to a new directory created to hold all of the reports (example filename convention: ATS_YYYY.Rmd)
Customize the setup for the report. Things that need to be altered are commented. These include:
focus_yr
(i.e. 2018)focus_tg
This is the name of the tag group as it appears in the tags
table of the database. Naming convention is the species abbreviation (fca for fall Chinook adult) + underscore + the calendar year in which they were all tagged, i.e. wst_2012
or fca_2017
.relative file paths to the database and the detections, for false detection screening data.
Knit the report. This will generate both an html document and a Word document. The figures in the Word document may not display optimally, so you may need to go through the code in the .Rmd and individually export figures with ggsave()
.
Don't take the reproducible report at face value - always read through it carefully to make sure it passes basic sanity checks. There may be unpredictable inconsistencies in each year's data that the report doesn't know how to handle automatically - make sure you include fixes for those in the individual year's .Rmd, not the template.
The template will need to be updated every so often; it's very basic and there's plenty of room for improvement. A good way to learn is to start by customizing the appearance! Eventually we could get it to a fully parameterized R Markdown Report :)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.