- An introduction to
ggplot2using volcano plots (Updated) - Using
DiagrammeRto draw flow charts (Updated)
- Data cleaning using
data.tableortidyverse(or PythonPandas) (Updated) - Cleaning strings using regular expressions with base R or
stringr(Updated)
- Creating SQL <> R workflows - Part 1 (Updated)
- Creating SQL <> R workflows - Part 2 (Updated)
- Automating R Markdown report generation - Part 1 (Updated)
- Automating R Markdown report generation - Part 2 (updated)
- TBC
- TBC
The resources below also cover a comprehensive range of practical R tutorials.
- Statistical Computing by Alex Reinhart and Christopher Genovese
- Data Science Toolkit by David Benkeser
- What They Forgot to Teach You About R by Jennifer Bryan and Jim Hester
This repository now contains the following file naming and code style rules.
- Folders are not ordered with a numerical prefix and names are not case sensitive e.g
r_tips\tutorials\...andr_tips\figures\... - Tutorial subtopics share the same prefix e.g.
r_tips\tutorials\dv-...for data visualisation tutorials andr_tips\tutorials\sm-...for statistical modelling tutorials - File names use
-to separate tutorial topics and_instead of other white space e.g.r_tips\figures\dv-using_diagrammer-simple_flowchart.svg - Comments are styled according to the tidyverse style guide:
- The first comment explains the purpose of the code chunk and is styled differently for enhanced readability e.g.
# Code as header -------- - Comments are written in sentence case and only end with a full stop if they contain at least two sentences
- Short comments explaining a function argument do not have to be written on a new line
- Comments should not be followed by a blank line, unless the comment is a stand-alone paragraph containing in-depth rationale or an alternative solution
- The first comment explains the purpose of the code chunk and is styled differently for enhanced readability e.g.
- To render github documents:
- Results are generally suppressed using
results='hide'and manually entered in a new line beneath the code - Figures are generally outputed using
fig.show='markdown'and individual figure outputs can then be suppressed usingfig.show='hide'in a code chunk
- Results are generally suppressed using
- Set a margin of 80 characters length in RStudio through
Tools\Global options --> Code --> Display --> Show marginand use this margin as the cut-off for code and comments length
Many kudos to Dr Chuanxin Liu, my former PhD student and code editor, for teaching me how to code in R in my past life as an immunologist.
