Not sure about R but I know python is an extremely mathematical language. (Used by A LOT of educational institutions in the UK) I assume R is used for the same reason. So, it would make sense for the computation, it would be stupid to use something like javascript because well it sucks at math.