I have a list of lists similar to df.
x <- list("a" = 3:5, "b" = 2:4,"c" = 1:3)
y <- list("a" = 1:3, "b" = 2:4,"c" = 3:5)
df <- list(x, y)
I convert the list of lists (df) into a data frame (data) following the next command:
data <- do.call(rbind.data.frame, df)
However, in data I want to keep the number of the list as a new variable (in this case, value 1 for the first 3 lines of data and 2 for the last 3 lines of data???
Any clue?