[R] how does a valid subscript can produce an "subscript out of bounds" error?
Duncan Murdoch
murdoch.duncan at gmail.com
Sat Jul 5 01:50:51 CEST 2014
On 04/07/2014, 6:35 PM, Witold E Wolski wrote:
> how does a valid subscript (see first 2 lines) can produce an
> "subscript out of bounds" error (see line 4)?
>
>
> 1> sum(!rownames(msexp$rt) %in% msexp$pepinfo$transition_group_id)
> [1] 0
> 2> sum(!msexp$pepinfo$transition_group_id %in% rownames(msexp$rt))
> [1] 0
> 3> class(msexp$rt)
> [1] "matrix"
> 4> msexp$rt = as.matrix(msexp$rt[msexp$pepinfo$transition_group_id,])
> Error in msexp$rt[msexp$pepinfo$transition_group_id, ] :
> subscript out of bounds
>>
>
How are we supposed to know, since you didn't show us
msexp$pepinfo$transition_group_id
or the thing it was indexing,
msexp$rt
? Please post reproducible examples.
Duncan Murdoch
More information about the R-help
mailing list