Message-ID: <CAOUXvx7EZMJiS2EtPurLoC7nuFinOL82j6xhb6j_TK-XdshBTQ@mail.gmail.com>
Date: 2017-05-29T00:20:30Z
From: Levi Waldron
Subject: [Bioc-devel] DataFrame errors with a Surv class column
Running and updated Bioc 3.5:
> library(survival)
> set.seed(1)
> cens <- sample(0:1, 100, replace=TRUE)
> time <- rnorm(100)
> df = DataFrame(time=time, cens=cens, y=Surv(time, cens))
> df[1:3, ] #OK
DataFrame with 3 rows and 3 columns
time cens y.from
<numeric> <integer> <Surv>
1 0.3981059 0 0.398105880367068:0
2 -0.6120264 0 -0.612026393250771:0
3 0.3411197 1 0.341119691424425:1
> df #error
DataFrame with 100 rows and 3 columns
*Error in unclass(x)[i, , drop = FALSE] : subscript out of bounds*
>
This came up after I noticed something similar in
MultiAssayExperiment::wideFormat() when trying to reshape a Surv column,
but I'm not sure it's a bug in MultiAssayExperiment:
> library(MultiAssayExperiment)
> miniACC$y <- Surv(miniACC$days_to_death, miniACC$vital_status)
> res = wideFormat(miniACC["EZH2", , ], colDataCols="y")
Show Traceback
Rerun with Debug
* Error in unclass(x)[i, , drop = FALSE] : subscript out of bounds *
>
[[alternative HTML version deleted]]