Session Ready
Exercise

How it works

Much of the material in this first lab is based on and borrowed from datacamp's own course "introduction to R". If you want more to get a more thorough introduction to R, please also complete datacamp's course "introduction to R".

In the editor on the right you should type R code to solve the exercises. When you hit the 'Submit Answer' button, every line of code in the script is interpreted and executed by R and you get a message that indicates whether or not your code was correct. The output of your submission is shown in the console in the lower right corner.

You can also execute R commands straight in the console. This is a good way to experiment with R code: When you type in the console, your submission will not be checked for correctness!

Instructions
100 XP
  • In the editor on the right there is already some sample code. Can you see which lines are actual R code and which are comments?
  • Add a line of code that calculates the sum of 6 and 12, and hit the 'Submit Answer' button.