Skip to content

[Bioc-devel] DataFrame errors with a Surv class column

2 messages · Levi Waldron, Michael Lawrence

#
Running and updated Bioc 3.5:
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
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:
Show Traceback

 Rerun with Debug
* Error in unclass(x)[i, , drop = FALSE] : subscript out of bounds *

  
  
1 day later
#
tail() is broken for Surv objects, because despite Surv objects exposing
their implementation as matrices (probably a bad decision), they do not
inherit from class "matrix". One option is to make length.Surv return the
number of elements (rows in the matrix) instead of the number of cells, but
who knows how much code that would break. I filed an issue on their GitHub
project: https://github.com/therneau/survival/issues/22

Michael


On Sun, May 28, 2017 at 5:20 PM, Levi Waldron <lwaldron.research at gmail.com>
wrote: