Convenient wrapper around the NoviSci web platform APIs.
To authenticate with the web platform you must first create an API key. You can generate an API key by logging into the web platform UI and then visiting your Profile page. Then click on the “Create New Api Key” link.
nswpr expects the API key to be made available through the NS_APIKEY
environmental variable. The value of this environmental variable can be set in many ways, but our recommendation is to set it using the ~/.Renviron
file. Whatever approach you use, it is important to never include your API key in any project code that might get checked in to the project Git repository.
When the R application starts up it searches for a site and user file to process for setting environment variables, unless the --no-environ
command-line argument is provided. These files are collectively called environmental files. One of the files that it searches for is the ~/.Renviron
file, unless an alternative location is specified through the R_ENVIRON_USER
environmental variable. Since the ~/.Renviron
file is typically not checked in to a Git project repository this makes it a convenient mechanism to use to set the NS_APIKEY
environmental variable for R sessions.
Environmental variables can be set in the environmental files by including a line in one of the files with a name=value
syntax. So in order to set the NS_APIKEY
environmental variable in the ~/.Renviron
file, you can add a line like the following to the ~/.Renviron
file.
Note that the ~/.Renviron
file may not already exist, in which case you would want to create one. You can use any text editor (such as RStudio) to create or edit this file.
For more information about the R startup process, see the R Startup
documentation (e.g. via a call to help(Startup)
).
Once your API key has been made available through the NS_APIKEY
environmental variable then you can call any of the Report & Causal Studio functions in the Reference section.
On the NoviSci Web Platform the report system supports two types of reports: