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 >> >
> x <- matrix(1,1,1) > rownames(x) <- colnames(x) <- "23" > 23 %in% rownames(x) [1] TRUE > x[23,] Error in x[23, ] : subscript out of bounds ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.