ref_get: Call the REF Impact Case Studies API

Description Usage Arguments Details Value Valid API methods SearchCaseStudies query argument Examples

Description

This function calls the REF Impact Case Studies API, and returns the dataset as a tibble. See the vignette for more details about how to use this function.

Usage

1
ref_get(api_method, tag_type = NULL, query = NULL)

Arguments

api_method

text, the API method you wish to call. Valid methods are summarised below, and documented on the REF Impact Case Studies website linked above, as well as in the vignette.

tag_type

integer, for ListTagValues method only. This is the ID of the tag type you wish to retrieve. See example usage below.

query

list, search parameters for use with the SearchCaseStudies method. See example usage below.

Details

Details about the API can be found at http://impact.ref.ac.uk/CaseStudies/APIhelp.aspx.

Value

Returns a tibble with nested data frames. To access the nested data frames, subset the tibble using the [[]] syntax. For more information, see the vignette.

Valid API methods

SearchCaseStudies query argument

This argument is used to pass search parameters through to the API. These parameters are passed as a named list, and you must provide at least one parameter for this method. There are 5 parameters:

For more information about how to use these parameters, see the vignette.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
institutions <- ref_get("ListInstitutions")
units_of_assessment <- ref_get("ListUnitsOfAssessment")
tag_types <- ref_get("ListTagTypes")
tag_type_5 <- ref_get("ListTagValues", 5L)
ref_get("SearchCaseStudies", query = list(ID     = c(27121,1698)))
ref_get("SearchCaseStudies", query = list(UKPRN  = 10007777))
ref_get("SearchCaseStudies", query = list(UoA    = 5))
ref_get("SearchCaseStudies", query = list(tags   = c(11280, 5085)))
ref_get("SearchCaseStudies", query = list(phrase = "hello"))
ref_get("SearchCaseStudies", query = list(UKPRN  = 10007146, UoA = 3))

refimpact documentation built on May 1, 2019, 8:47 p.m.