Storage room
Séance 5 : Advanced manipulation of Data Objects¶
- Filtration, sélection et structuration de données d’intérêt
- dplyr
- Tutorials :
- Brendan R. E. Ansell : Introduction to R - tidyverse
- https://bookdown.org/ansellbr/WEHI_tidyR_course_book/manipulating-data-with-dplyr.html : chapter 5 manipulating data with dplyr
- Brendan R. E. Ansell : Introduction to R - tidyverse
Séance 5 : Structures de contrôle
- Condition if/else
- Exercices
Séance 6 et 7 : Les fonctions
- Création de nouvelles fonctions
- Fonctions avancées : apply and co
- Tests et exceptions
- Exercices
- Tutorials
- Notes de cours de R - Version 2, Ewen Gallic :
- R for Data Science (O'Reilly Book tidyverse) 1er :
- Custom function : https://r4ds.had.co.nz/functions.html chapter 19
Séance 8 et 9 : Les graphiques en R
- concepts de base et fonctions génériques
- ggplot2
- Tutorials :
- Brendan R. E. Ansell : Introduction to R - tidyverse
- Notes de cours de R - Version 2, Ewen Gallic (français) :
- Introduction to R - tidyverse Brendan R. E. Ansell
- https://bookdown.org/ansellbr/WEHI_tidyR_course_book/what-the-factor.html : rappel factor + factor in plots → section 8
- Exercices
Séance 10 : Récapitulatif général du savoir faire pour application à l'analyse SingleCell RNA-Seq
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Session 3¶
Best practices :
- https://www.r4epi.com/coding-best-practices.html R for epidemiology - Brad Cannell, chapter 10
- Advanced R by Hadley Wickham http://adv-r.had.co.nz/Style.html
Séances 2 et 3 : Les objets R
- Conventions & bonnes pratiques
- Revenir sur le nommage des variables
- Syntaxe virgule, espaces…
- Pas de
?fonction
dans le script - Les commentaires
- Présentation et manipulation des différents types d’objets : vecteurs, matrices, data frames et listes
- Object R
- Vecteur
- Référencement des éléments
- names
- length
- Factor
- Levels
- str
- Matrices
- Dimensions [ , ]
- Dataframes
- Référencement des éléments de la dataframe
- colnames/rownames
- Dim
- List
- [[ ]], $
- Names
- unlist
- Tutorials :
- O’Reilly Book 1 Hands-On Programming with R :
- https://rstudio-education.github.io/hopr/r-objects.html (Chapter 5)
- https://rstudio-education.github.io/hopr/r-notation.html#selecting-values chapter 6.1 manipulating vectors
- https://rstudio-education.github.io/hopr/r-notation.html#dollar-signs-and-double-brackets chapter 6.4 : subsetting lists with brackets and $
- Brendan R. E. Ansell : Introduction to R - tidyverse
- https://bookdown.org/ansellbr/WEHI_tidyR_course_book/welcome-to-r.html#data-frames : dataframes
- Factors but it may be too early for these explanations : https://bookdown.org/ansellbr/WEHI_tidyR_course_book/what-the-factor.html
- Notes de cours de R - Version 2, Ewen Gallic :
- R for Data Science (O'Reilly Book tidyverse) 2e :
- Factors : https://r4ds.hadley.nz/factors.html
- O’Reilly Book 1 Hands-On Programming with R :
- Vecteur
- Exercices
Data structure - Data-frames : https://bookdown.org/ansellbr/WEHI_tidyR_course_book/welcome-to-r.html#data-frames : Brendan R. E. Ansell : Introduction to R - tidyverse - Chapter 1.14
https://rstudio-education.github.io/hopr/r-notation.html#dollar-signs-and-double-brackets
- Fonctions de bases
- Son fonctionnement
- Usage
- Paramètre
- Détails
- Exemple
- ?, help
- typeof()
- Vecteurs, c()
- Head, length, str, rep, seq, table
- Mean, min, max, paste,
- is.[...]
- Tutorials :
- O’Reilley Book 1 Hands-On Programming with R
- https://rstudio-education.github.io/hopr/basics.html#functions : chapter 2.3 + 2.5 (chapter 2.4 seems too early, it’s about custom functions)
- Brendan R. E. Ansell : Introduction to R - tidyverse : https://bookdown.org/ansellbr/WEHI_tidyR_course_book/welcome-to-r.html#help : How to use the help section (chapter 1.9) very short
- R for Data Science (O'Reilly Book tidyverse) 2e :
- https://r4ds.hadley.nz/workflow-basics.html (chapter 3.1-3.3 variable assignation and small intro & chapter 3.4 small intro and examples about functions)
- O’Reilley Book 1 Hands-On Programming with R
- Exercices
- Son fonctionnement
- Quizz général sur les notions de la session 1
idées questions
- Which variable names are incorrect :
Packages¶
[https://hbctraining.github.io/Intro-to-R-flipped/lessons/04_introR_packages.html]
R works in a model of package “add-ons” where packages are collections of functions, data sets, and other resources that extend the functionality of the base R system.
As R is used by many communities (biologists, economists, statisticians, meteorologists…), several R packages were designed to address specific tasks or provide specialized tools for the different domains or areas of interest.
Therefore, many (most) of R packages are available in the official CRAN package repository but we will also use packages from Bioconductor (open source software for Bioinformatics).
When you start an R session, default packages are automatically loaded allowing you to use R as a calculator and access basic mathematical functions. Some of the key default packages include:
- base: It provides basic data structures (vectors, matrices, data frames, lists), operators for calculations (+, -, *, /), control structures (if-else, loops), and functions for mathematical operations, such as log(), sin(), cos(), and many more.
- stats: This package contains functions for statistical analysis and modeling. It includes methods for probability distributions, hypothesis testing, regression, analysis of variance, and other statistical procedures. Some commonly used functions from this package are mean(), sd() or t.test().
- graphics: The graphics package provides functions for creating plots and visualizations. It includes functions for basic plots (scatter plots, bar plots, histograms), customization options, and annotation features. The functions plot(), hist() or boxplot() are examples of functions available in this package.
- utils: This package contains utility functions that assist in data manipulation, file handling, and other miscellaneous tasks. Functions like head(), tail(), str(), and install.packages() are part of this package._ _
To be able to use the functionalities of a R package, you need to load the package in your current R environment. Here is a small video to show you how to install, load R packages.