Greatly inspired by:
http://www.burns-stat.com/pages/Tutor/R_inferno.pdf
R is not the best designed/intuitive programming language in the world and it's very easy to make mistakes.
It is a bit of organic Perlish language which has grown out of need.
Some of the syntax is Perlish
1) Namespaces! Accidental variable reuse or function overloading is a very easy mistake to make in R. I try to prepend package names as often as I can to specify the actual function I need.
2) Factors and strings. Enough said.
3) Welcome to indexing hell.
Sometimes things work too well. Imagine index =c(0,1,...,) of size n and I do this:
x[index]
then I just get elements 1 over and over
what I wanted to do was:
x[as.logical]
Sometimes don't work well enough. A single index matrix is no longer a matrix!
This means that special cases need to be written when accessing a single row or column (fml).
No comments:
Post a Comment