Re: [Bioc-devel] DataFrameList to Wide Format DataFrame

2021-12-17 Thread Hervé Pagès
On 16/12/2021 23:00, Dario Strbenac via Bioc-devel wrote: Hello, Ah, yes, the sample names should of course be in the rows - Friday afternoon error. In the question, I specified "largely the same set of features", implying that the overlap is not complete. So, the example below will error.

Re: [Bioc-devel] DataFrameList to Wide Format DataFrame

2021-12-17 Thread Michael Lawrence via Bioc-devel
This is more of a support site question. The stack() function is relevant here, but it won't fill in the missing columns. Note though that there are some conveniences that might help a tiny bit, like how colnames(DFL) returns a CharacterList, so you can do unique(unlist(colnames(DFL))). In

Re: [Bioc-devel] DataFrameList to Wide Format DataFrame

2021-12-16 Thread Dario Strbenac via Bioc-devel
Hello, Ah, yes, the sample names should of course be in the rows - Friday afternoon error. In the question, I specified "largely the same set of features", implying that the overlap is not complete. So, the example below will error. DFL <- DataFrameList(X = DataFrame(a = 1:3, b = 3:1,

Re: [Bioc-devel] DataFrameList to Wide Format DataFrame

2021-12-16 Thread Hervé Pagès
A metadata column on a DataFrame runs along its 2nd dimension so is not a good place to put the list names. Have you tried unlist()?   library(S4Vectors)   DF <- DataFrame(id=letters[1:10], score=runif(10))   f <- sample(LETTERS[1:3], 10, replace=TRUE)   DFL <- split(DF, f)   DFL   #

[Bioc-devel] DataFrameList to Wide Format DataFrame

2021-12-16 Thread Dario Strbenac via Bioc-devel
Good day, Is there a function in the S4Vectors API which converts a DataFrameList into a DataFrame, automatically putting the list names into one of the metadata columns, analogous to MultiAssayExperiment's wideFormat function? The scenario is mutliple data sets from different organisations