Vectorizing your functions


Photo by Ashkan Forouzani on Unsplash

Vectors

x <-1:5x[1] 1 2 3 4 5
x + 2[1] 3 4 5 6…


Photo by Mika Baumeister on Unsplash

Basic data types in R

  • Decimal values like 4.5 are called numerics.
  • Natural numbers like 4 are called integers. Integers are also numerics.
  • Boolean values (TRUE or FALSE) are called logical.
  • Text (or string) values are called characters.

Constants in R

# Change my_numeric to be 42
my_numeric <- 42
# Check class…

Photo by Lukas Blazek on Unsplash

Things to know before learning R

Lilian Hale

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store