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.

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.

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.

Details

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

Valid API methods

  • ListInstitutions (no arguments)

  • ListTagTypes (no arguments)

  • ListTagValues (tag_type is a compulsory argument)

  • ListUnitsOfAssessment (no arguments)

  • SearchCaseStudies (query is a compulsory argument - see below)

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:

  • ID - Takes a single ID or a vector of IDs. If you use this parameter you cannot use any of the other 4 parameters.

  • UKPRN (UK Provider Reference Number) - takes a single UKPRN. You can get a list of valid values using the ListInstitutions method.

  • UoA - This is a code referencing a Unit of Assessment, and you can get a list of valid values from the ListUnitsOfAssessment method. Takes a single UoA.

  • tags - This is one or more codes referencing tags from the ListTagValues method. When multiple tags are provided to the search method, it will only return rows which contain both tags. To help you discover tags that you can use here, you can look at the ref_tags dataset (bundled with this package)

  • phrase - You can search the database using a text query. The query must conform to Lucene search query syntax.

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

Examples

# \donttest{ 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)))
#> # A tibble: 2 x 19 #> CaseStudyId Continent Country Funders ImpactDetails ImpactSummary ImpactType #> <chr> <list> <list> <list> <chr> <chr> <chr> #> 1 1698 <df[,2] … <df[,2… <chr [… "\n The i… "\n The i… Societal #> 2 27121 <df[,2] … <df[,2… <chr [… "\n The p… "\n Resea… Societal #> # … with 12 more variables: Institution <chr>, Institutions <list>, #> # Panel <chr>, PlaceName <list>, References <chr>, #> # ResearchSubjectAreas <list>, Sources <chr>, Title <chr>, UKLocation <list>, #> # UKRegion <list>, UOA <chr>, UnderpinningResearch <chr>
ref_get("SearchCaseStudies", query = list(UKPRN = 10007777))
#> # A tibble: 7 x 19 #> CaseStudyId Continent Country Funders ImpactDetails ImpactSummary ImpactType #> <chr> <list> <list> <list> <chr> <chr> <chr> #> 1 32987 <df[,2] … <df[,2… <chr [… "\r Impac… "\r `Cold… Cultural #> 2 32989 <df[,2] … <df[,2… <chr [… "\n Kenna… "\n Peter… Cultural #> 3 32990 <df[,2] … <df[,2… <chr [… "\r Impac… "\r Resea… Cultural #> 4 44130 <df[,2] … <df[,2… <chr [… "\r Build… "\r Desig… Societal #> 5 44131 <df[,2] … <df[,2… <chr [… "\r The R… "\r A sus… Societal #> 6 44132 <df[,2] … <df[,2… <chr [… "\r Dunne… "\r Dunne… Societal #> 7 44133 <df[,2] … <df[,2… <chr [… "\r Impac… "\r Vehic… Societal #> # … with 12 more variables: Institution <chr>, Institutions <list>, #> # Panel <chr>, PlaceName <list>, References <chr>, #> # ResearchSubjectAreas <list>, Sources <chr>, Title <chr>, UKLocation <list>, #> # UKRegion <list>, UOA <chr>, UnderpinningResearch <chr>
ref_get("SearchCaseStudies", query = list(UoA = 5))
#> # A tibble: 257 x 19 #> CaseStudyId Continent Country Funders ImpactDetails ImpactSummary ImpactType #> <chr> <list> <list> <list> <chr> <chr> <chr> #> 1 2372 <df[,2] … <df[,2… <chr [… "\r\n Imp… "\r\n For… Technolog… #> 2 2373 <df[,2] … <df[,2… <chr [… "\r\n Res… "\r\n Rel… Technolog… #> 3 2374 <df[,2] … <df[,2… <chr [… "\r\n Wee… "\r\n Dec… Environme… #> 4 2375 <df[,2] … <df[,2… <chr [… "\n Impac… "\n Since… Environme… #> 5 2376 <df[,2] … <df[,2… <chr [… "\r\n a) … "\r\n A n… Environme… #> 6 3140 <df[,2] … <df[,2… <chr [… "\n Shapi… "\n Durin… Environme… #> 7 3141 <df[,0] … <df[,0… <chr [… "\n Over … "\n New a… Environme… #> 8 3143 <df[,2] … <df[,2… <chr [… "\r\n The… "\r\n By … Technolog… #> 9 3144 <df[,2] … <df[,2… <chr [… "\r\n Car… "\r\n Pro… Technolog… #> 10 3145 <df[,2] … <df[,2… <chr [… "\n The V… "\n Cytom… Health #> # … with 247 more rows, and 12 more variables: Institution <chr>, #> # Institutions <list>, Panel <chr>, PlaceName <list>, References <chr>, #> # ResearchSubjectAreas <list>, Sources <chr>, Title <chr>, UKLocation <list>, #> # UKRegion <list>, UOA <chr>, UnderpinningResearch <chr>
ref_get("SearchCaseStudies", query = list(tags = c(11280, 5085)))
#> # A tibble: 24 x 19 #> CaseStudyId Continent Country Funders ImpactDetails ImpactSummary ImpactType #> <chr> <list> <list> <list> <chr> <chr> <chr> #> 1 590 <df[,2] … <df[,2… <chr [… "\r\n Wyl… "\r\n Wyl… Societal #> 2 1919 <df[,2] … <df[,2… <chr [… "\r\n Imp… "\r\n Eme… Societal #> 3 3682 <df[,2] … <df[,2… <chr [… "\r\n Rob… "\r\n Pro… Societal #> 4 3684 <df[,2] … <df[,2… <chr [… "\r\n In … "\r\n Res… Societal #> 5 4886 <df[,2] … <df[,2… <chr [… "\n Rob J… "\n Over … Societal #> 6 6367 <df[,2] … <df[,2… <chr [… "\n Dyer'… "\n The g… Societal #> 7 7261 <df[,2] … <df[,2… <chr [… "\r\n Our… "\r\n The… Societal #> 8 28201 <df[,2] … <df[,2… <chr [… "\n See s… "\n Appro… Societal #> 9 36246 <df[,2] … <df[,2… <chr [… "\n Influ… "\n Since… Societal #> 10 40298 <df[,2] … <df[,2… <chr [… "\r\n The… "\r\n The… Societal #> # … with 14 more rows, and 12 more variables: Institution <chr>, #> # Institutions <list>, Panel <chr>, PlaceName <list>, References <chr>, #> # ResearchSubjectAreas <list>, Sources <chr>, Title <chr>, UKLocation <list>, #> # UKRegion <list>, UOA <chr>, UnderpinningResearch <chr>
ref_get("SearchCaseStudies", query = list(phrase = "hello"))
#> # A tibble: 7 x 19 #> CaseStudyId Continent Country Funders ImpactDetails ImpactSummary ImpactType #> <chr> <list> <list> <list> <chr> <chr> <chr> #> 1 1698 <df[,2] … <df[,2… <chr [… "\n The i… "\n The i… Societal #> 2 11805 <df[,2] … <df[,2… <chr [… "\n The c… "\n Resea… Legal #> 3 23842 <df[,0] … <df[,0… <chr [… "\r\n Bar… "\r\n Res… Societal #> 4 27121 <df[,2] … <df[,2… <chr [… "\n The p… "\n Resea… Societal #> 5 28223 <df[,2] … <df[,2… <chr [… "\n A sig… "\n This … Political #> 6 35385 <df[,2] … <df[,2… <chr [… "\n Paju … "\n ARU i… Cultural #> 7 39882 <df[,2] … <df[,2… <chr [… "\n Creat… "\n This … Societal #> # … with 12 more variables: Institution <chr>, Institutions <list>, #> # Panel <chr>, PlaceName <list>, References <chr>, #> # ResearchSubjectAreas <list>, Sources <chr>, Title <chr>, UKLocation <list>, #> # UKRegion <list>, UOA <chr>, UnderpinningResearch <chr>
ref_get("SearchCaseStudies", query = list(UKPRN = 10007146, UoA = 3))
#> # A tibble: 2 x 19 #> CaseStudyId Continent Country Funders ImpactDetails ImpactSummary ImpactType #> <chr> <list> <list> <list> <chr> <chr> <chr> #> 1 3912 <df[,0] … <df[,0… <chr [… "\n This … "\n This … Societal #> 2 3913 <df[,2] … <df[,2… <chr [… "\n Persi… "\n Aroun… Health #> # … with 12 more variables: Institution <chr>, Institutions <list>, #> # Panel <chr>, PlaceName <list>, References <chr>, #> # ResearchSubjectAreas <list>, Sources <chr>, Title <chr>, UKLocation <list>, #> # UKRegion <list>, UOA <chr>, UnderpinningResearch <chr>
# }