Problem Installing Packages in Rstudio

This is usually due to a PATH problem, as solved here or there.

Check the value of:

Sys.getenv("PATH")

and

Sys.which("stats.dll")

And check where R is actually installed on your system, to see if there is a discrepancy.