Install and update R from R

install.packages("installr")

library(installr)

updateR()

updateR(fast = FALSE, browse_news = FALSE, install_R = TRUE, copy_packages = TRUE, 
        copy_Rprofile.site = TRUE, keep_old_packages = TRUE, update_packages = TRUE,
        silent = TRUE)

install.Rtools()