I would like to create a list of vectors. The first vector should contain only the first value specified, while the second value should contain the first and second and so on. This is obviously very manageable for a small number of values but I have a large number of values I would like to do this for.
For example:
vec_numbers <- c(1, 2, 3, 4, 5)
Will result in five vectors
vec1 <- 1
vec2 <- c(1,2)
vec3 <- c(1,2,3)
vec4 <- c(1,2,3,4)
vec5 <- c(1,2,3,4,5)
finallist <- list(vec1, vec2, vec3, vec4, vec5)
I would also like to do this for character vectors, not just numeric.