Learn R Programming

fedreporter (version 0.2.1)

fe_projects_search: Search Federal RePORTER Projects

Description

Search Federal RePORTER Projects

Usage

fe_projects_search(project_number = NULL, fiscal_year = NULL, text = NULL,
  text_field = c("title", "abstract", "terms"), text_operator = c("AND",
  "OR"), agency = NULL, pi_name = NULL, offset = 1, limit = 50,
  verbose = TRUE, secure = TRUE)

Arguments

project_number

unique number that is assigned to a project by the affiliated federal agency. Examples, 5R01MH092950-05, 1R01CA183929-01A1, USFS-0000779. Can also use wildcards such as *R01*.

fiscal_year

Fiscal year of data to obtain

text

Search text from title, abstract, and terms data

text_field

text field to search, can be title, abstract or terms, and defaults to search all. Only enabled when text is not NULL.

text_operator

Text operator to combine text terms, Can be AND or OR, AND is default. Only enabled when text is not NULL.

agency

Agency code to search. see fe_agencies

pi_name

Principal investigator name. Names are to be in the Last First M, Last, First, First, Last, or First Last formats. Multiple names can be given.

offset

start at item # (starts at 1)

limit

max # of items to return (at the most 50 per request)

verbose

print diagnostic messages

secure

Should https be used, passed to fe_base_url

Value

List of the result of the GET call and the content

Examples

Run this code
# NOT RUN {
res = fe_projects_search(
project_number = "USFS*",
fiscal_year = 2012)
res = fe_projects_search(
project_number = "*R01*",
fiscal_year = 2012,
agency = "NIH",
text = "stroke",
text_field = "title")

# }
# NOT RUN {
res = fe_projects_search(pi_name = "MATSUI, ELIZABETH")
items = res$content$items
con_pis = sapply(items, "[[", "contactPi")
keep = grepl("^MATSUI", con_pis)
items = items[keep]
mat_costs = sapply(items, "[[", "totalCostAmount")
sum(mat_costs)

res = fe_projects_search(pi_name = "PENG, ROGER")
items = res$content$items
con_pis = sapply(items, "[[", "contactPi")
keep = grepl("^PENG", con_pis)
items = items[keep]
peng_costs = sapply(items, "[[", "totalCostAmount")
sum(peng_costs)

both = fe_projects_search(
pi_name = c("MATSUI, ELIZABETH", "PENG, ROGER"))
# }

Run the code above in your browser using DataLab