Please make sure you are using a recent version of R (current version is 3.6.X) - the final digit is the minor version number. The essential numbers are the first two. You can check the version of R you are running via
R.version.string
Please install the latest version of RStudio (https://www.rstudio.com/products/rstudio/download/).