Skip to content

Instantly share code, notes, and snippets.

@Kumquatum
Created September 17, 2018 17:52
Show Gist options
  • Save Kumquatum/81a26b6e3c18649d40e44d6fa6f4842e to your computer and use it in GitHub Desktop.
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
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