Question: why r is so slow?
Answer: Why is R so slow compared to other programming languages? Because it was never intended to run fast. Or, to be more precise, it's primary goal is not of generating a fast-running native code. R is about convenience and speed of work of it's user (be it data scientist, economist or public health analytic).