r - list of character vectors of unequal length to data.frame -


i have named list looks this:

> head(pathways) $<na> null $`2` [1] "hsa04610" $`9` [1] "hsa00232" "hsa00983" "hsa01100" $`10` [1] "hsa00232" "hsa00983" "hsa01100" $<na> null $<na> null 

to describe more formerly. name of each list id number, , entries of each element of character vector elements of list id number. can filter out $<na> entries is.na(), want change rest like:

id   another_id 2    hsa04610    9    hsa00232    9    hsa00983    9    hsa01100    10   hsa00232   10   hsa00983 10   hsa01100   > dput(test) structure(list(`na` = null, `2` = "hsa04610", `9` = c("hsa00232",  "hsa00983", "hsa01100"), `10` = c("hsa00232", "hsa00983", "hsa01100" ), `na` = null, `na` = null), .names = c(na, "2", "9", "10",  na, na)) 

any ideas?

so found answer seems work.

stack(pathways)

this seems easy, oh well.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -