When you see the message:
"Package XXXX is not available in this version of R..."
1) install package installr
2) run the following command after installation
installr::install.Rtools()