I have got 10 data.frames, each one with only one column, contained within a list and I have to convert them into numeric vectors.
Here an example of my 10th data.frame within the list:
Here are two ways to convert a list of data.frames, each with one column to a list of unnamed vectors.
your_new_list <- lapply(your_list, unlist, use.names = FALSE)
2) Using the extraction operator,
your_new_list <- lapply(your_list, "[[", 1)
Here's a sample list to try it out:
set.seed(1234) your_list <- list(data.frame(a=1:10), data.frame(a=rnorm(50)), data.frame(b=letters[1:10]))