R/get_apikey_from_file.r

Defines functions get_apikey_fromfile

Documented in get_apikey_fromfile

#' Get value of algaebase API key from a file 
#' @param keyfile path to text file
#'
#' @export get_apikey_fromfile
#' @return api key as character string (invisibly)
#'
#' @examples \dontrun{apikey<-get_apikey_fromfile("keyfile.txt")}

get_apikey_fromfile<-function(keyfile)
{
  #keyfile should be a text file with the API key on the first line
  apikey<-readLines(con=keyfile,n=1,warn=FALSE)
  invisible(apikey) #will invisibly return result
  
}

Try the algaeClassify package in your browser

Any scripts or data that you put into this service are public.

algaeClassify documentation built on Nov. 22, 2023, 1:08 a.m.