Closed LiNk-NY closed 7 years ago
yes, length(<S4Object>)
is 1 by default; I agree it should be prod(dim)
. Thanks Marcel
That would only make sense if it were modeled as a vector. Ordinary R matrices expose their vector implementation and support length()
and x[i]
, but that drops them to a vector. Do you really want to mimic that behavior, i.e., what would x[i]
do? What is the i'th element of a RE?
Hi Michael, @lawremi
That's a good question.
x[i]
represents a subset of the i'th rows in a features by samples representation.
Actually, it doesn't follow the matrix contract closely because you get an endomorphic subset of the rows rather than the first element of this vector ([1, 1]
) when doing x[1]
.
Marcel
In that case, it should behave like SummarizedExperiment and return the number of rows. It's effectively a vector of rows. A bit weird, but that's how many of our classes behave. I often wonder whether that confuses users.
Hi Martin, @mtmorgan
In the example:
The length returned is
1
. InSummarizedExperiment
, length returns the number of rows (odd?). Should this output be accepted forRaggedExperiment
?Considering this to be a matrix representation,
length
should return something likedim[[1]] * dim[[2]]
?Marcel