Here are the steps for installing the required environment to run the OHDSI R packages. Four things needs to be installed:
Go to https://cran.r-project.org/, click on ‘Download R for Windows’, then ‘base’, then click the Download link indicated in the screenshot below.
After the download has completed, run the installer. Use the default options everywhere, with two exceptions: First, it is better not to install into program files. Instead, just make R a subfolder of your C drive as shown below. Second, to avoid problems due to differing architectures between R and Java, disable the 32-bit architecture as also shown below.
Once completed, you should be able to select R from your Start Menu.
Go to https://cran.r-project.org/, click on ‘Download R for Windows’, then ‘Rtools’, and select the very latest version of RTools to download.
After downloading has completed run the installer. Select the default options everywhere.
Since R v4.0.0 you also need to add the following line to your .Renviron file, as described on the RTools page:
Go to https://www.rstudio.com/, select ‘Download RStudio’ (or the ‘Download’ button under ‘RStudio’), opt for the free version, and download the installer for Windows as highlighted below.
After downloading, start the installer, and use the default options everywhere.
Go to https://java.com/en/download/manual.jsp, and select the Windows 64-bit installer as highlighted below. If you also installed the 32-bit version of R, you must also install the other (32-bit) version of Java.
After downloading just run the installer.
You should now be ready to go, but we should make sure. Start R-studio, and type
install.packages("SqlRender") library(SqlRender) translate("SELECT TOP 10 * FROM person;", "postgresql")
##  "SELECT * FROM person LIMIT 10;"
This function uses Java, so if all goes well we know both R and Java have been installed correctly!
Another test is to see if source packages can be built. Run the following R code to install the
CohortMethod package from the OHDSI GitHub repository:
install.packages("drat") drat::addRepo("OHDSI") install.packages("CohortMethod")