On the R-way to hell

Statistical analysis in the marvelous world of R

Early version needed to be severely updated/modified
Author

Julien Martin

Published

2024-10-30

Doi

Preface

Warning

Book in development. Several sections not developed yet

The aim of this book

The aim of this book is two-fold:

  1. introduce you to R, a powerful and flexible interactive environment for statistical computing and research.
  2. introduce you to (or reacquaint you with) statistical analysis done in R.

R in itself is not difficult to learn, but as with learning any new language (spoken or computer) the initial learning curve can be steep and somewhat daunting. It is not intended to cover everything (neither with R not with statistics) but simply to help you climb the initial learning curve (potentially faster) and provide you with the basic skills (and confidence!) needed to start your own journey with R and with specific analysis.

Multilingual book

The book is provided as a multilingual book breaking that language barrier and potentially allow to facilitate the learn of R and its mainly english-speaking environment. We are always looking for volunteers to help developed the book further and add more languages to the growing list. Please contact us if you want to help

On the web version of the book, use in the navigation bar to switch from one language to another. After switching to your preferred language, you can of course also download the pdf and epub versions in this language if you want to using .

List of languages:

  • english (work in progresspublish but need polishing)
  • french (in development, waiting for english to be polished)
  • spanish (one day maybe)
  • … volunteers for more ??

How to use this book

For the best experience we recommend that you read the web version of this book which you can find https://biostats-uottawa.github.io/Rway.

The web version includes a navbar at the top of the page where you can toggle the sidebars on and off , search through the book , change the page color and suggest revisions if you spot a typo or mistake . You can also download a pdf and epub versions of the book.

We use a few typographical conventions throughout this book.

R code and the resulting output are presented in code blocks in our book.

2 + 2
[1] 4

Functions in the text are shown with brackets at the end using code font, i.e. mean() or sd() etc.

Objects are shown using code font without the round brackets, i.e. obj1, obj2 etc.

R packages in the text are shown using code font and followed by the πŸ“¦ icon, i.e. tidyverse πŸ“¦.

A series of actions required to access menu commands in RStudio or VSCode are identified as File -> New File -> R Script which translates to β€˜click on the File menu, then click on New File and then select R Script’.

When we refer to IDE (Integrated Development Environment software) later in the text we mean either RStudio of VScode.

When we refer to .[Rq]md, we mean either R markdown (.Rmd) or Quarto (.qmd) documents and would generally talk of R markdown documents when referring to either .Rmd or .qmd files.

The manual tries to highlight some part of the text using the following boxes and icons.

Exercises

Stuff for you to do

Solutions

R code and explanations

Warning

warnings

Important

important points

Note

notes

Who are we ?

 

Julien Martin is a Professor at the University of Ottawa working on Evolutionary Ecology and has discovered R with version 1.8.1 and teaches R since v2.4.0.

Thanks

The first part of the book on using R started as a fork on github from the excellent An introduction to R book by Douglas, Roos, Mancini, Couto and Lusseau (Douglas 2023). It was forked on April 23rd, 2023 from Alexd106 github repository then modified and updated following my own needs and teaching perspective of R. The content was neither reviewed nor endorsed by any the previous developers.

Several parts in the book were based on previous lab manuals for biostatistics classes at uOttawa written by Martin, Findlay, Morin and Rundle.

Site that provided a lot of information for the book:

Image credits

Photos, images and screenshots are from Julien Martin except when indicated in caption.

Cover image was generated via Nightcafe Ai Art generator. Favicon and hex sticker were created from the cover image.

Note

several screenshot are currently by Alex Douglas and are being redone to abide by the previous statement

License

I share this work under the license License Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.

License Creative Commons

If you teach R, feel free to use some or all of the content in this book to help support your own students. The only thing I ask is that you acknowledge the original source and authors. If you find this book useful or have any comments or suggestions I would love to hear from you (contact info).

Citing the book

Julien Martin. (2024). On the R-way to hell. A multilingual introduction to R book. Version: 0.6.0 (2024-10-30).DOI: 10.5281/zenodo.13801263

Course associated reading

Table 1: Course associated reading for biostatistical course at uOttawa
Chapter

BioXx58

Bio8940

Using R
1.-4. βœ…βœ… πŸ˜ƒ
5. Programming βœ…βœ…
6. Reproducible reports βœ”οΈ βœ…βœ…
7. Version control βœ…βœ…
Stats fundamentals
all chapters βœ…βœ… πŸ˜ƒ
Linear models
all chapters βœ…βœ… πŸ˜ƒ
Generalized linear models
all chapters βœ”οΈ βœ…βœ…
Mixed models
all chapters βœ…βœ…
Generalized additive models
all chapters βœ”οΈ
Multivariate analysis
all chapters βœ”οΈ
Bayesian approach
all chapters βœ…βœ…
Suggested βœ”οΈ ; mandatory βœ…βœ… ; expected knowledge (might need a refresher) πŸ˜ƒ

Hex Sticker