[R] Weird error: Error in xj[i] : invalid subscript type 'list'

David Winsemius dwinsemius at comcast.net
Thu Oct 29 17:46:24 CET 2009


On Oct 29, 2009, at 12:28 PM, Peng Yu wrote:

> I got the error. I haven't been able to get a stand along case so that
> I can show it here. But could somebody give some clue on what could
> cause this error? Since I never defined xj[i], I don't understand
> where this error come from.
>
> Error in xj[i] : invalid subscript type 'list'
>

This reminds me of the stories told by guys coming into emergency  
rooms who have been involved in fights:

"I was just sitting on the corner, minding my own business, when I was  
attacked by this error".

 > xj <- 1:4
 > xj[list(1,2)]
Error in xj[list(1, 2)] : invalid subscript type 'list'

-- 

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list