Created
September 17, 2018 17:52
-
-
Save Kumquatum/81a26b6e3c18649d40e44d6fa6f4842e to your computer and use it in GitHub Desktop.
Re-organising a nested list to a new list were inside lists are the outside list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(purrr) | |
mini = list( | |
fpkm = list( | |
A = data.frame(x = c(1,3,4), y = c(23,634,12)), | |
B = data.frame(x = c(4,7,8), y = c(22,857,35)) | |
), | |
counts = list( | |
A = data.frame(x = c(0.1,0.3,4), y = c(0.23,0.634,0.12)), | |
B = data.frame(x = c(0.4,0.7,0.8), y = c(0.22,0.857,0.35)) | |
) | |
) | |
mini_new = mini %>% transpose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment