I have a set of vector (over 2k) that each contain over 13k entries. I need to loop over each of them to place the data in a txt files for future uses.
So I thought I would create a list, containing the name of all the vector:
vector_list <- list()
for (i in 1:Number) {
vec <- paste("vec", i, sep="")
assign(vec, data[i,1])
vector_list[i] <- vec
}
Only problem is that when I access the value of vector_list[-]
, I get the correct name, but it's in between "" so I cannot use it to evaluate the value of the vector whose name is between the "".
when I write
TEST <- vector_list[i]
I do not get the value contained in the veci
(whose name is stored in the vector_list[i]
) but I get "veci"
... Any help about this?
I also tryed the command get
which does not seems to work. For example, if I type get(vector_list[1])
I get Error in get(vector_list[1]) : invalid first argument
.
Similar if I use a<-vector_list[1]
then get(a)
. Perhaps I am the one misusing the get
fonction..?