Skip to content
Snippets Groups Projects
Commit 617ce352 authored by Ben Anderson's avatar Ben Anderson
Browse files

Merge branch 'add_resources' into 'master'

Add reproducibiliTea resources

See merge request SERG/workflow!9
parents e58122c0 1a7441c4
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,8 @@ reqLibs <- c("data.table", # data munching ...@@ -9,7 +9,8 @@ reqLibs <- c("data.table", # data munching
"here", # here "here", # here
"lubridate", # dates and times "lubridate", # dates and times
"ggplot2", # plots "ggplot2", # plots
"skimr" # for skim "skimr", # for skim
"bookdown" # for making reports (should also install knittr etc)
) )
# load them # load them
woRkflow::loadLibraries(reqLibs) woRkflow::loadLibraries(reqLibs)
...@@ -41,7 +42,7 @@ makeGWPlot <- function(dt){ ...@@ -41,7 +42,7 @@ makeGWPlot <- function(dt){
dt[, weekDay := lubridate::wday(rDateTime, label = TRUE)] dt[, weekDay := lubridate::wday(rDateTime, label = TRUE)]
# draw a megaplot for illustrative purposes # draw a megaplot for illustrative purposes
p <- ggplot2::ggplot(dt, aes(x = rDateTime, p <- ggplot2::ggplot(dt, aes(x = rDateTime,
y = GENERATION/1000000, y = GENERATION/1000,
colour = weekDay)) + colour = weekDay)) +
geom_point() + geom_point() +
theme(legend.position = "bottom") + theme(legend.position = "bottom") +
...@@ -51,13 +52,13 @@ makeGWPlot <- function(dt){ ...@@ -51,13 +52,13 @@ makeGWPlot <- function(dt){
return(p) return(p)
} }
version <- 10 version <- 10
makeReport <- function(f,version){ makeReport <- function(f){
# default = html # default = html
rmarkdown::render(input = paste0(here::here("Rmd", f),".Rmd"), # we love here:here() - it helps us find the .Rmd to use rmarkdown::render(input = paste0(here::here("Rmd", f),".Rmd"), # we love here:here() - it helps us find the .Rmd to use
params = list(title = title, params = list(title = title,
subtitle = subtitle, subtitle = subtitle,
authors = authors), authors = authors),
output_file = paste0(here::here("docs", f),version,".html") # where the output goes output_file = paste0(here::here("docs", f),".html") # where the output goes
) )
} }
......
...@@ -14,4 +14,14 @@ ...@@ -14,4 +14,14 @@
* we have written a [short guide](gitBranches.md) * we have written a [short guide](gitBranches.md)
* [HappyGit](https://happygitwithr.com/fork-and-clone.html) gives you the details * [HappyGit](https://happygitwithr.com/fork-and-clone.html) gives you the details
* [ohshitgit](https://ohshitgit.com/) may be required here too (but not if you've followed the instructions above) * [ohshitgit](https://ohshitgit.com/) may be required here too (but not if you've followed the instructions above)
* using [git(hub/lab) issues](https://guides.github.com/features/issues/) as a way to manage your project - just like we did for the [new ECCD website](https://git.soton.ac.uk/SERG/sergwebsite/-/issues) * using [git(hub/lab) issues](https://guides.github.com/features/issues/) as a way to manage your project - just like we did for the [new ECCD website](https://git.soton.ac.uk/SERG/sergwebsite/-/issues)
\ No newline at end of file
Even more ...
* on [naming files (tidyverse)](https://style.tidyverse.org/files.html)
* coding style, syntax etc. with [lintr](https://github.com/jimhester/lintr)
* set up projects as packages with help from [usethis](https://usethis.r-lib.org/)
* tools for reproducibility
* Is your project file reproducible? [fertile](https://github.com/baumer-lab/fertile) might help
* Or try [rrrpkg](https://github.com/ropensci/rrrpkg) to create a research compendium
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment