3 ms·
> I don't understand why people would want to do mathematics in imperative languages. R isn't exactly what I'd call your typical imperative language. It's mor
by Mikeb85 12y ago
> I don't understand why people would want to do mathematics in imperative languages.
R isn't exactly what I'd call your typical imperative language. It's more like the love child of APL and Scheme, with random bits thrown in by a bunch of statisticians.
Loops are almost never used in R, since pretty much everything is a vector (or some sort of data structure made of vectors), you simply apply functions to vectors and it maps over the whole thing.
Of course, the C, C++ and Fortran bits are 'imperative', which is kind of the structure you describe anyway (functional, vectorized R language which calls down to a bunch of C/Fortran functions).