Creating plots mirrored along the y-axis

Good code example: https://www.r-bloggers.com/making-back-to-back-histograms/

Adding lines to barplots + 2 y-axes

Explanation as to why base plot should be saved as a separate object and referenced in subsequent plots: https://www.r-bloggers.com/adding-lines-or-points-to-an-existing-barplot/

Good code example: https://stackoverflow.com/questions/15277712/adding-lines-to-barplot-in-a-different-y-axis-in-r

Importing multiple files to R

Modified from this link.

coverageFiles <- list.files(pattern = "*bedgraph") #Create a file list for all 10 files to import
list2env(lapply(setNames(coverageFiles,
make.names(gsub("s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_", "", coverageFiles))), read.table),
envir = .GlobalEnv) #Import files with list2env. Use lapply to setNames of the files by taking all the common parts of their names out. Files will be named zr2096_#_5x.bedgraph

Creating a plot with a gapped axis

I used the plotrix package to add an axis break to a grouped bar plot.

R Studio notes: https://rstudio-pubs-static.s3.amazonaws.com/235467_5abd31ab564a43c9ae0f18cdd07eebe7.html

Artificially grouping bars to create a grouped bar plot with an axis break: https://stackoverflow.com/questions/24202245/grouped-barplot-with-cut-y-axis

My final code: https://github.com/eimd-2019/NIX-project/blob/master/scripts/Population-versus-Year%20Graph.R

Updating R using updateR package

https://www.linkedin.com/pulse/3-methods-update-r-rstudio-windows-mac-woratana-ngarmtrakulchol

Ignoring previously committed files

https://stackoverflow.com/questions/3833561/why-doesnt-git-ignore-my-specified-file/3833675

Add legend to outside of multipanel plot

Google lead me to a solution from Katie Lotterhos! I found it extremely useful.

http://dr-k-lo.blogspot.com/2014/03/the-simplest-way-to-plot-legend-outside.html