Connect to AACT using R

'R' is a free, reliable and popular software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS. R provides one of the easiest and cheapest ways to access and analyze the wealth of information in the AACT database.

You can access the PostgreSQL AACT database in the cloud using 'R' without needing to install PostgreSQL on your local machine.


Download & Install R (Optionally RStudio)

If R (and RStudio) not already installed on your local machine, you may install from the following links:


Connect R (or RStudio) to AACT

Once R is installed, launch R (or RStudio) and enter the following commands at the prompts.


> install.packages("RPostgreSQL") trying URL '' Content type 'application/x-gzip' length 306320 bytes (299 KB) ================================================== downloaded 299 KB > library(RPostgreSQL) Loading required package: DBI > drv <- dbDriver('PostgreSQL') > con <- dbConnect(drv, dbname="aact",host="", port=5432, user="aact", password="aact") > aact_sample <- dbGetQuery(con, "select distinct study_type from studies") > write.csv(aact_sample, file='aact_sample.csv') > print(aact_sample)