. useneoftidytutsLearnr tutorials
Tutorials are available to run through with the R package learnr. These are interactive tutorials that give practice and exercises to supplement this site.
We recommend you run through the learnr tutorials on your own computer with RStudio by following the instructions outside of this box.
However, if you cannot get it to easily work or you prefer you can run it on the course webVNC you were provided (if you are not on the course you will have to run this through your own computer).
To run the tutorial on the webVNC run the following use script on a new terminal:
Then follow the instructions on the terminal.
Rtools for windows
If you are using a windows machine you will need to have RTools installed. Close your RStudio (or equivalent) and open the below link:
https://cran.r-project.org/bin/windows/Rtools/
- Click on the the latest version
- On the new page find and click on the “RToolsXX INstaller” (XX being the number of the version, e.g. 45) to download the installer
- Run the installer
Once RTools is installed you can open up RStudio and run the below.
Install instructions
You will need R and RStudio installed on your computer.
Within RStudio you will need to install the learnr package and the packages our learnr tutorials require. Below are the R commands to install these.
#learnr
install.packages("learnr")
#tidyverse
install.packages("tidyverse")
#lterdatasample
install.packages("lterdatasampler")
#INstall hexbin
install.packages("hexbin")
#Our packages are available through github rather than cran
#To install github based packages you need to install and load
# the remotes package
install.packages("remotes")
library("remotes")#mgrtibbles
remotes::install_github("m-gemmell/mgrtibbles")
#neoftidytutorials
#Package with the tidyverse learnr tutorials
remotes::install_github("m-gemmell/neoftidytutorials")Libraries
Prior to running any tutorials (next page) you must load the learnr and neoftidytutorials packages in your RStudio.
library("learnr")
library("neoftidytutorials")Tutorials
There are various tutorials to run through for different sections of this website. Below shows you the order and how to run each tutorial.
Important notes about these tutorials:
- Progress is saved: If you close the tutorial and reopen it on the same computer & RStudio it will continue from where you left off
- Run in browser: You can click on the “Open in Browser” button at the top of the RStudio window with the tutorial to open the tutorial in a web browser
- Split screen: The intended way to run through the tutorials is with the tutorial on one half of your screen and this website at the relevant page on the other half
Tibble
The first tutorial is on Tibbles.
To run the tutorial run the below learnr command.
Note: Ensure you have followed the install directions before this and you have loaded the library (library("neoftidytutorials")).
learnr::run_tutorial("tibbles", package = "neoftidytutorials")Whilst running through the tutorial refer to the Tibble section of this website.
Dplyr
The second tutorial is on the dplyr package.
learnr::run_tutorial("dplyr", package = "neoftidytutorials")Whilst running through the tutorial refer to the dplyr section of this website.
Tidyr
The third tutorial is on the tidyr package.
learnr::run_tutorial("tidyr", package = "neoftidytutorials")Whilst running through the tutorial refer to the tidyr section of this website.
Ggplot2
The fourth tutorial is on the ggplot2 package.
learnr::run_tutorial("ggplot2", package = "neoftidytutorials")Whilst running through the tutorial refer to the ggplot2 section of this website.