Re:ARrgh: a newcomer's angry guide to R (2013)
by alilja on Sunday December 14, 2014 @08:04PM
(#8750222)
The worst part of R is that array indices begin at 1, and trying to get an array at 0 will fail silently by returning 0. I've spent many a night trying to figure out why all my data is wrong because my_array[0] * frame$column is returning the wrong numbers.
[ Parent
| on HN ]
Re:ARrgh: a newcomer's angry guide to R (2013)
by princeb on Monday December 15, 2014 @12:33AM
(#8750811)
this gets brought up again and again with no agreement and the only advice I know how to give you is that when working in any language that has mathematics as its primary focus (mathematica, matlab, Julia, R), you use 1-index, and other languages you use 0-index.
Re:ARrgh: a newcomer's angry guide to R (2013)
by redacted on Monday December 15, 2014 @03:09AM
(#8751063)
alilja's issue isn't 1-indexing, it's R's completely insane decision to return usable numerical values for an array access error. In Mathematica or Matlab accidentally using 0-indexing would lead to obvious errors, while in R it often doesn't - especially if you have sparse/many zero data already