Coding basics

R as a calculator

1 / 200 * 30
## [1] 0.15
#> [1] 0.15
(59 + 73 + 2) / 3
## [1] 44.66667
#> [1] 44.66667
sin(pi / 2)
## [1] 1
#> [1] 1

assignment symbol

x <- 3 * 4

What’s in a name?

Calling functions

Use of TAB

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

continuation character, +

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

Printing to screen

y <- seq(from = 1, to = 10)