| To save others some of the head-banging sessions I've had with R: R has an integer division operator, %/%. R gives you the ability to define your own infix operators, as long as you give them symbols that start and end with %. Here's the kicker--all such operators have a higher precedence than multiply and divide, which can lead to unexpected results. R as a programming language can be frustrating. It has scalar values; you just can't store one in a variable (it becomes a vector of length one). Some functions and operators will work with vectors of arbitrary length... but some require a vector of length one. (Speaking of which, binary operations on vectors are done by adding corresponding elements, BUT if one operand runs out first, it will start picking them off from the beginning again, with a warning if the length of the longer one isn't a multiple of the length of the shorter one. This may be surprising.) The wonky list notation takes time to get used to: foo[1] gives you a sublist; chances are you want foo[[1]]. Deciding which of the *apply() functions you want can be a pain. What passes for lambda expressions in R is clunky. m:n gives you a vector of m, m + 1, ..., n... unless M > n, in which case it assumes you want m, m - 1, ..., n, so 1:0 won't give you an empty vector. This makes for clumsy special case code. |
Is that really the case, though? It seems like `function (args) body` is about as simple as it gets, and just as simple as in many other languages.