R/x_get_institutions.R

Defines functions get_institutions

Documented in get_institutions

#' List Institutions
#'
#' DEPRECATED - USE ref_get. This function uses the \code{ListInstitutions}
#' method from the database API and returns a list of institutions and
#' associated metadata, including the UKPRN.
#'
#' @return Returns a data_frame (from the \code{tibble} package).
#'
#' @examples
#' \dontrun{
#' get_institutions()
#' }
#'
#' @export
get_institutions <- function() {
  .Deprecated("ref_get")

  ##### Call the API #####
  query_url <- "http://impact.ref.ac.uk/casestudiesapi/REFAPI.svc/ListInstitutions"
  tmp <- tibble::as_data_frame(jsonlite::fromJSON(query_url))

  return(tmp)

}
perrystephenson/refimpact documentation built on May 17, 2022, 8:31 p.m.