I am using dplyr and have a dataframe where one of the columns contains vectors/lists. I'd like to create a column that contain the element of the vector with index i (an exterior variable).
e.g. with i = 2
I have tried:
data <- data %>% mutate (element = list_x [i])
But I get the ith element of the column list_x rather than the ith element of each vector contained in the column...