Coding basics

R as a calculator

1000 / 10
## [1] 100
x <- 1000 / 10
x
## [1] 100

assignment symbol

x <- blabla

What’s in a name?

names have to start with a letter

Calling functions

Use of TAB

Can’t remember the exact name, start writing it and TAB. R will give you suggestions

seq(from = 1, to = 10, by = 1)
##  [1]  1  2  3  4  5  6  7  8  9 10

continuation character, +

  • means that something is missing
seq(from = 1, to = 10)
##  [1]  1  2  3  4  5  6  7  8  9 10

Printing to screen

You need to type the name after assigning it.

y <- seq(from = 1, to = 10)
y
##  [1]  1  2  3  4  5  6  7  8  9 10