#' @title gtr_further_funding
#'
#' @description This function checks whether a project receives further fudning
#' @param url project URL from gtr.ukri.org
#' @export
#' @return Further funding dataframe
gtr_further_funding<-function(url){
firmTEST<-httr::GET(url,httr::add_headers("Accept: application/vnd.rcuk.gtr.json-v7"))
firmTEXT<-httr::content(firmTEST, as="text")
JLfirm<-jsonlite::fromJSON(firmTEXT, flatten=TRUE)
ORG<-JLfirm$projectOverview$projectComposition
proj_id<-ORG$project$grantReference
proj_title<-ORG$project$title
imp<-ORG$project$output
funding_df<-imp$furtherFundingOutput
FFdf<-dplyr::mutate(funding_df,project_id=proj_id,project_title=proj_title)
FFdf$start<-lubridate::year(anytime::anytime(FFdf$start/1000))
FFdf$end<-lubridate::year(anytime::anytime(FFdf$end/1000))
#CHECK<-is.list(funding_df)
#if (CHECK==TRUE){
# FUR<-FALSE
#}else{FUR<-TRUE}
return(FFdf)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.