dsc_login: Login to the drugshortagescanada.ca web API

Description Usage Arguments Details Examples

View source: R/drugshortagescanada.R

Description

This function logs in to the DSC web API and stores the auth-token in the 'dsc.authtoken' R environment variable so that it is accessible dsc_search()

Usage

1
dsc_login(email, password)

Arguments

email

Your email address used to log into the DSC

password

Your password

Details

You should not need usually to call this function directly, as it is called by dsc_search() if the auth-token has not be set.

The username and password can be passed into the function, or can be set via and environment variable. See the examples below.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  dsc_login("bill.gates@microsoft.com", "passw0rd!")

  # You can also set environment variables
  Sys.setenv("dsc.email" = "bill.gates@microsoft.com")
  Sys.setenv("dsc.password" = "passw0rd!")

  dsc_login()

  # These credentials can also be stored in the .Renviron file in the current
  # directory

pipitone/drugshortagesr documentation built on Jan. 13, 2020, 3:21 p.m.