Aan de slagGa gratis aan de slag

Your first R script

Welcome! In the script to the right you will type R code to solve the exercises. When you hit the Submit Answer button, every line of code in the script is 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 R console.

You can also execute code directly in the R Console. When you type in the console, your submission will not be checked for correctness! Try, for example, to type in 3 + 4 and hit Enter. R should return [1] 7.

Deze oefening maakt deel uit van de cursus

Introduction to R for Finance

Cursus bekijken

Oefeninstructies

  • An addition example has already been created for you.
  • Add another line of code in the script to calculate the difference of 6 and 4.
  • Note: Check out the # symbol in the script! This denotes a comment in your code. Comments are a great way to document your code, and are not run when you submit your answer.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Addition!
3 + 5

# Subtraction!
Code bewerken en uitvoeren