Please follow all steps explained below to setup your RStudio environment for this course and to solve your first RTutor problem set.
Download R 3.6.3 (base version) from here:
Pick your operation system and the the subdirectory base
. If you have a Windows PC you can directly click here:
https://cran.r-project.org/bin/windows/base/
The install the downloaded file. You don’t need to adapt the default install options.
We will not directly start R, but use RStudio instead. Go to the following link to download RStudio onto your laptop and then install it:
https://www.rstudio.com/products/RStudio/#Desktop
It is not necessary to check/uncheck special options if you do not want to do so.
Click to watch a Youtube video for Step 2
You should now definitely set the following options in RStudio to make sure that RTutor does not get caught in a state of perpetual error.
Go in RStudio to the Menu Tools -> Global Options
. Set the options for “Workspace” as highlightes in yellow in the Screenshot below and then press “Ok”.
Personally I also turn off the default global option to show output of R code inline in RMarkdown documents. I think this makes RTutor problem sets easier to work with, but that is a matter of taste. See the screenshot to turn of that options:
Please, follow this step even if you have already RTutor installed. I have updated RTutor
and sktools
since the last course.
Click to watch a Youtube video for Step 3
Download the file install_packages.R
from Moodle and open it with R-Studio. (You can just double click on the file in your file browser or choose in RStudio File -> Open File
)
You should now see a screen like the following:
Run
Button on the top right corner of the top left window. You should do this line by line - in case there are error messages that have to be dealt with. The complete installation may take some while.Click to watch a Youtube video for Step 4
Create a folder in which you save all your RTutor problem sets of this course, like C:/courses/ma/RTutor
. Try to avoid any letters in your path that are not used in the english alphabet (e.g. no ü
or ä
or ß
).
Download the first problem set Intro.zip from Moodle and extract the ZIP it in your problem set directory. If you are a Windows user and don’t know how to extract a ZIP file see e.g. the description here.
Now open the file Intro.Rmd in RStudio. (You can double click on the file in your file explorer or choose in RStudio the menu entry File -> Open File
.)
Set your name in the file by changing the line
user.name = 'ENTER A USER NAME HERE' # set to your user name
for example to
user.name = 'clara_ulmer' # set to your user name
Your username should identify you and be the same for each problem set. Again avoid special character like ü
or ß
.
```{r "1_a"} # enter your code here ... ```
Change it to
```{r "1_a"} 123 + 257 ```
Check Problemset
(see screenshot below)Now continue solving the problem set. Use Check Problemset
after each chunk you have worked on. If you have checked a chunk and get an error You can type anytime hint()
, to get a hint.
Follow the information at the end of the problem set to make a submission file that you can upload on Moodle.
If RTutor behaves strangely follow the Guide for fixing errors when solving a problem set that is on Moodle.
Instead of clicking on the Addin Check Problemset
you might want to use a shortcut on your keyboard. To add one, follow these steps:
Open the menu entry Tools -> Addins -> Browse Addins...
A window opens. Choose the row labelled R Tutor Check Problemset
by clicking on it. Then click on the button in the bottom left corner Keyboard Shortcuts
.
You can now add your preferred keyboard shortcut in the middle column. Just click in the middle column, enter your shortcut like CTRL + G and save it.
Now every time you want to check your problem set, you just have to press that keyboard shortcut.