README.md

ftRtools

ftRtools is a package of internal FT Data Science tools for R.

Installation

To use the redshift query elements of this package you need Java SE JDK installed. To install the package from Github use install_github function from the devtools package.

devtools::install_github("Financial-Times/ftRtools")

Credentials

To access FT Redshift you will need to use your credentials and be on the FT network. Do not hard code you username and password into files using these tools. Instead, use one of the available alternatives, two of which are described below.

.Renviron

One way to save your credentials is in a .Renviron file in your home directory and to include .Renviron in your .gitignore. These variable can be accessed using Sys.getEnv() as follows:

redshift_query("my_query.sql",
               "int",
               Sys.getenv("username"),
               Sys.getenv("password"))

For more information on the .Renviron file, see here

RStudio API

If you are working in RStudio, you can use the RStudio API as follows.

redshift_query("my_query.sql",
               "int",
               rstudioapi::askForPassword("username"),
               rstudioapi::askForPassword("password"))

Bear in mind that if using this method, you will need to input your credentials every time you run this code.



Financial-Times/ftRtools documentation built on Oct. 29, 2021, 9:59 a.m.