knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(targets) library(ggplot2)
The bulk of the computation should have already happened upstream, and the most of the code chunks in the report itself should be terse calls to tar_read() and tar_load().
--https://books.ropensci.org/targets/files.html#literate-programming
This report summarizes our results, mostly as terse calls to tar_read()
.
For implementation details, see the underlying targets pipeline:
writeLines(readLines("_targets.R"))
To make this project easy to reproduce and share we built the R package ds.targets. You can install it from GitHub with:
# install.packages("devtools") devtools::install_github("2DegreesInvesting/ds.targets")
To clean the raw data we removed observations where Ozone
values were missing.
# Source code ds.targets::clean # Before raw_data <- tar_read(raw) any(is.na(raw_data$Ozone)) # After clean_data <- tar_read(data) any(is.na(clean_data$Ozone))
To explored changes in Ozone
through time we use a linear model.
Here are our results:
tar_read(lm_plot)
We see no evidence that Ozone changes through time.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.