Reorder geom_bar or anything else in ggplot by the value of your choosing

You still find recent answers on StackOverflow counseling to redefine the factors of a data.frame to reorder elements of a ggplot graphic. In the 2020’s, this can be avoided. Factors are a heritage of a numerical focus of R, when text values were seen as an anomaly or, at best, as ordinal values. I highly […]

Draw anything you want with R on the Cartesian grid

Most of the graphics documenation in R is dedicated to high level plotting packages. Sometimes, these packages remind me of LaTeX: you spend less time producing graphical elements you need than getting rid of elements you have not asked for. Some of these packages are great, of course, and you should definitely use them for […]

Premiers pas avec R et RStudio

Cet exercice a pour préalable d’avoir installé R et RStudio. Se familiariser avec l’interface Ouvrez RStudio. Vous devriez voir l’interface comme à l’image ci-dessous, pour l’heure sans la partie A. La partie C est en principe vide: Les fonctions de ces différentes parties sont les suivantes: A : Fenêtre d’édition des fichiers sources. Ici vous […]