nsf_return.RdNote that it can only return a maximum of 9976 grants per call.
nsf_return(
keyword = NULL,
zipcode = NULL,
agency = "NSF",
statecode = NULL,
startdate = NULL,
enddate = NULL,
verbose = TRUE,
print_fields = print_fields_get(),
save_file = NULL
)Optional keyword to search on
Optional zip code to limit search to (note that you should try both 5 and 9 digit). Note that there are often grants that lack zip code info
Agency to search for (NSF or NASA)
Two letter state code for the awardee location
Start date for award date to search. Accepted date format is mm/dd/yyyy (ex.12/31/2012)
End date for award date to search. Accepted date format is mm/dd/yyyy (ex.12/31/2012)
If TRUE, outputs progress
Names of elements to return (see NSF API documentation)
File to save results to while running
A data frame with returned info
ants <- nsf_return(keyword="Formicidae")
#> [1] "Finished first batch"
nsf_wordcloud(ants$abstractText)
sanderson <- nsf_return(keyword="Sanderson")
#> [1] "Finished first batch"
#>
Finished next batch of 25 records; now 50 records from 2000 to 2014
Finished next batch of 25 records; now 75 records from 1992 to 2014
Finished next batch of 11 records; now 86 records from 1970 to 2014
mjs.PI <- sanderson[grepl("Michael J Sanderson",sanderson$pdPIName),] #note the lack of period for middle initial in the search string
mjs.CoPI <- sanderson[grepl("Michael J Sanderson",sanderson$coPDPI),]
mjs.grants <- rbind(mjs.PI, mjs.CoPI)
plot(x=lubridate::mdy(mjs.grants$startDate), y=mjs.grants$fundsObligatedAmt, pch=20, log="y", bty="n", xlab="Start date", ylab="Funding amount in US dollars")