R/set_token.R

#' Set the Stattleship API token
#'
#' A simple function to set the Stattleship API token in an R environment variable
#'
#' @param token character. A valid Stattleship API token
#' @examples
#' \dontrun{
#' set_token("insert-your-token-here")}
#' @export
#' set_token

set_token <- function(token){
    if(!is.null(token)){
        .StattleEnv$data$token <- token
    }
    else{
        warning("Stattleship API token must be provided in order to access the Stattleship API.")
    }
}
stattleship/stattleship-r documentation built on May 30, 2019, 10:43 a.m.