ComeçarComece de graça

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.

Este exercício faz parte do curso

Introduction to R for Finance

Ver curso

Instruções do exercício

  • 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.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Addition!
3 + 5

# Subtraction!
Editar e executar o código