Code Is Poetry

Life is Binary

Vectors in R

#vectors
v1 <- c(1,5,11,33)
v2 <- c(2,5,11,13)
v1+v2

v <- rep(0,10)
v <- rep(1:10, times=2)
v
v <- rep(1:10, each=2)
v
v <- seq(10,20,2)
v1 <- 1:5

v2 <- 2:10
v2 <- c(2,3,4,5,6,7,8)
v2
v2[2:4]
v2[6:9]
sd(v2)
sum(v2)
# summation calculations can be applied over entire vector
sum(v1)