Initialize an empty vector and add things to it
vec <- numeric(0)
vec <- c(vec, i)
Replace values of a vector following a condition with something else
vec[is.na(vec)] <- a
Disable scientific notation in R
options(scipen = 999)
vec <- numeric(0)
vec <- c(vec, i)
vec[is.na(vec)] <- a
options(scipen = 999)