View source: R/nih_grant_scraper.R
write_nih_deadlines_excel | R Documentation |
This function takes a character vector of NIH grant page URLs and an output file path, calls
parse_nih_due_dates
to extract key dates and metadata from each grant page, transforms
the result into a transposed matrix (so that deadlines appear as rows and grants as columns),
and writes the resulting data frame to an Excel file using the xlsx
package.
write_nih_deadlines_excel(urls, output_path)
urls |
A character vector of NIH grant opportunity page URLs. |
output_path |
A character string specifying the full file path (including filename) for the output Excel file. |
The transformation process involves:
Converting the resulting wide tibble (with one row per grant) into a matrix.
Setting the URL values as row names.
Replacing NA
values with empty strings for aesthetics.
Transposing the matrix so that deadline dates become row labels and metadata columns become columns.
Converting the transposed matrix back to a data frame and writing to an Excel file.
Invisibly returns the final data frame written to Excel.
## Not run:
urls <- c("https://grants.nih.gov/grants/guide/pa-files/PAR-25-362.html",
"https://grants.nih.gov/grants/guide/pa-files/PAR-23-198.html")
write_nih_deadlines_excel(urls, "./NIH_deadlines.xlsx")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.