I have a list with 10000 nested lists containg two components ("x" and "y"). e.g.
iter1 <- list(x = c(8500, 8510, 8520, 8530), y = c(1.2, 1.3, 1.4, 1.5))
iter2 <- list(x = c(8490, 8500, 8510, 8520, 8530), y = c(1.2, 1.2, 1.3, 1.4, 1.5))
iter3 <- list(x = c(8510, 8520, 8530, 8540, 8550, 8560), y = c(1.2, 1.2, 1.3, 1.4, 1.5, 1.6))
All <- list(iter1 = iter1, iter2 = iter2, iter3 = iter3)
I'd like to create a dataframe and transfrom the y componenent from each and turn them into a column that corresponds to the matching x values to give something like below.
# iter1 iter2 iter3
# 8490 NA 1.2 NA
# 8500 1.2 1.2 NA
# 8510 1.3 1.3 1.2
# 8520 1.4 1.4 1.2
# 8530 1.5 1.5 1.3
# 8540 NA NA 1.4
# 8550 NA NA 1.5
# 8560 NA NA 1.6
I have tried many ways but have so far failed. Is there an effective way to do this?
Many thanks, Graham