Updating r version
When this happens, there is typically an informative error message about the missing package(s).
Download the current RTVS from https://aka.ms/rtvs-current. RTVS will check for a suitable version of Visual Studio and will also help you install an R interpreter if you haven't already.
package is a standard R package, and it installs and is loaded in the normal manner.
There are, however, a few installation issues, particularly on Macintosh systems, and these are described in this document.
Only the two last ones will probably need to be installed since the others are included with most distributions of R.
If you have to install R, all required information can be found on the CRAN website.