You can connect and directly query your data via SQL using R. Here we are using R within the Rstudio IDE, but the same steps will work within a standard R session or Revo R.

Firstly you will need to install the RPostgreSQL package.

Once the package is installed we can activate it and establish a connection to the deltaDNA database:

You can also connect over SSL:

It is recommended that you connect from R using SSL as from March of 2018 we will no longer be accepting unencrypted connections to Direct Access.

Setting the SSL mode to require ensures that an SSL connection is used however there are other options you can configure the connection with – these can be found in 31.17.3 of the PostgreSQL SSL Support documentation.

Where you the user, password are the username and password you use to login to www.deltadna.net, and dbname is your company name and game name as shown in the address bar of your browser on the www.delatDNA.net e.g. demo-co.my-demo-game  NB there should be a full stop between the account name and the game name.

DBeaverDatabaseSchema
You can then write queries as R strings and pass them to the database, they will be returned as R data frames