ComeçarComece de graça

Data type exploration

To get started, here are some of R's most basic data types:

  • Numerics are decimal numbers like 4.5. A special type of numeric is an integer, which is a numeric without a decimal piece. Integers must be specified like 4L.
  • Logicals are the boolean values TRUE and FALSE. Capital letters are important here; true and false are not valid.
  • Characters are text values like "hello world".

Este exercício faz parte do curso

Introduction to R for Finance

Ver curso

Instruções do exercício

  • Assign the numeric 150.45 to apple_stock.
  • Assign the character "AAA" to credit_rating.
  • Answer the final question with either TRUE or FALSE, we won't judge!
  • Print my_answer!

Exercício interativo prático

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

# Apple's stock price is a numeric
apple_stock <- 

# Bond credit ratings are characters
credit_rating <- 

# You like the stock market. TRUE or FALSE?
my_answer <- 

# Print my_answer
Editar e executar o código