knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Note this article relates to a legacy functions. Its capabilities are now covered by get_resources()
.
The query_resource_all()
function enables you to retrieve all records for a particular resource using a search term. If you want to limit the records returned to a specific institution, this requires additional arguments.
query_resource_combination()
uses a list of defined combinations of resources (gtr_combinations
) as well as an id
argument to refine the records and only include those that match your resource combination and id
.
First you will need to check gtr_combinations
to identify what resource combinations are required. The first resource in these combinations is what we will be filtering against using the id
argument, and the second resource are the records that will be returned (eg. the "organisation project" combination will return all projects for a specific organisation, where the organisation is determined by the id
).
Next you need to retrieve the id
that will be used to filter the resource. This can be done by using the query_resource_all
function and making note of the id
of the relevant record.
You can now use query_resource_combination
function with the two resources found in gtr_combinations
and the id
retrieved from query_resource_all
.
You want to return all projects linked to the University of Exeter.
library(gtR) exeter_id <- query_resource_all( resource = "organisation", search_term = "Exeter" ) id <- "961756BF-E31F-4A13-836F-0A09BA02385C" data <- query_resource_combination( resource = "organisation", output = "project", "961756BF-E31F-4A13-836F-0A09BA02385C", size = 10 ) data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.