2. R basics: console, objects, vectors
CWRU · STAT 312/312R
Console & arithmetic
2 + 3
10 / 4
sqrt(16)
log(10, base = 10)
Objects & assignment
x <- 5
y <- 2 * x
y
class(y)
Vectors
v <- c(2, 4, 6, 8)
v + 1
mean(v); sd(v)
Try it
- Create a vector with temperatures in °C and convert to °F using vectorized math.
- Compute its mean and standard deviation.