Dear all,
It seems that the devel branch of Bioconductor has made
changes/improvements on the behavior of as.data.frame. In the case that
input is a GRanges with a meta column of data frame, as.data.frame in
devel will flatten the nested data frame. I made an example below:
library(GenomicRanges
Hi Jialin,
Note that up to BioC 3.7, as.data.frame(gr) in your example
was returning a broken data.frame:
> as.data.frame(gr)
Error in dim(rvec) <- dim(x) :
dims [product 6] do not match the length of object [1]
More precisely, the call to as.data.frame(gr) is successful and
returns a d
Dear Hervé,
It seems that the printing method is broken not because the data frame
has nested data frame, but because the nested data frame has "AsIs"
class, for example:
> df <- data.frame(x = c(1,2))
> df$d <- data.frame(z = c(3,4))
> df
x z
1 1 3
2 2 4
> str(df)
'data.frame': 2 obs. of 2