R is a calculator

2 + 2
## [1] 4
100 / 7
## [1] 14.28571
22/17 + 37/47 + 88/83
## [1] 3.141593

You can store values

a <- 2 # read this like "a is assigned 2"
a + 2
## [1] 4

Parentheses are important for harder math

1 + 1^2
## [1] 2
(1+1)^2
## [1] 4

Always use parentheses if you’re not sure

(10 + 1) / (7 + (8^2))
## [1] 0.1549296

R supplies some nice math functions

sqrt(9.8696)
## [1] 3.141592
sin(1)
## [1] 0.841471
cos(12)
## [1] 0.843854
log(10) # default base is e
## [1] 2.302585
exp(1)
## [1] 2.718282