The goal of this package is to provide interactive tutorials for the tidyverse training module. The tutorial are shamelessly taken from rstudio-education for the basics of R and the tidyverse. Tutorials are packaged so you can install them on you computer and do the exercices without access to an internet connection.
You only need to perform each of the following steps once:
- installing R
- installing Rstudio
- installing R packages
remotes
andlearnr
However each of them may take some time.
Go to the CRAN webpage, select your OS and follow the instructions.
- On Windows, you should just download and execute an .exe file.
- On MacOS, you should just download and execute a .pkg file.
- On Linux, you can get install R from the command line using something like
## If you're on Ubuntu
sudo apt-get install r-base
Go to the download page. Select, download and install the file corresponding to your OS.
Launch Rstudio (by clicking on the corresponding icon) and execute the following commands in the console
install.packages("remotes")
install.packages("learnr")
On Windows: you may need Rtools and git
- Rtools: visit the dedicated page, download the suggested exe and install it on your computer
- git: visit the dedicated page, download the suggested exe and install it on your computer
On MacOS: you may need XCode
- XCode: visit the dedicated page, download the Mandatory tools and install them on your computer
You need to install the tutorials every time there is an update (hopefully not too often)
You can install the tutorials from GitHub by launching Rstudio and typing the following command in the console:
remotes::install_github("mahendra-mariadassou/tidytraining")
Whenever we fix a bug / typo or add new content, you need to update the tutorials on your computer. To do so, start a fresh Rstudio session and type the following command in the console:
remotes::install_github("mahendra-mariadassou/tidytraining")
This package is intended for use with learnr
:
library(learnr)
You should only launch one tutorial at the time. Before launching a new tutorial, restart R.
## Launch only one tutorial at the time!!
learnr::run_tutorial("01_programming_basics", package = "tidytraining")
learnr::run_tutorial("02_visualisation_basics", package = "tidytraining")
learnr::run_tutorial("03.1_tibbles", package = "tidytraining")
learnr::run_tutorial("03.2_isolating_data", package = "tidytraining")
learnr::run_tutorial("03.3_summaries", package = "tidytraining")
learnr::run_tutorial("04.1_reshape_data", package = "tidytraining")
learnr::run_tutorial("04.2_separate_columns", package = "tidytraining")
learnr::run_tutorial("04.3_join_datasets", package = "tidytraining")
If you have an error when launching a vignette (it may happen on Windows with R 4.0.0), try this syntax (illustrated on the first vignette):
rmarkdown::run(file = NULL,
dir = learnr:::get_tutorial_path("01_programming_basics",
package = "tidytraining"),
shiny_args = list(launch.browser = 1))