There’s a joke about R:
The good news is that R is a language for statistics, designed by statisticians.
The bad news is that R is designed by statisticians.
As you note, Richard, R can be very slow. R loops are more or less non-functional for performance reasons. R contains a number of options for expressions that perform the same operations as a loop that experienced R programmers use instead.
One of the features of R is the knitr package that allows R code to be mixed with LaTex (a type setting language). This allows you to write a paper that can be compiled and executed to generate computations, tables and graphics. I used this feature for my Masters degree project. The end result was a paper that I published on SSRN and Research Gate.