Skip to content

Commit

Permalink
Merge pull request #168 from CVPIA-OSC/funding-element
Browse files Browse the repository at this point in the history
Funding element
  • Loading branch information
ErinCain authored Aug 7, 2023
2 parents 26fdca0 + e3def62 commit bb1973d
Show file tree
Hide file tree
Showing 71 changed files with 248 additions and 117 deletions.
17 changes: 5 additions & 12 deletions R/funding-element.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,25 @@
#' @param award_number (Optional) The identifier assigned by the funding agency to identify this funding award.
#' @param award_url (Optional) Optional to include a link to information about the funding
#' award on the funding organization's webpage.
#' @param funding_description (Optional) Provide a short description of the funding received.
#' @return An award list that is then added to the project element of an EML file.
#' @examples
#' create_funding(funder_name = "National Science Foundation",
#' funder_identifier = "http://dx.doi.org/10.13039/100000001",
#' award_number = "1656026",
#' award_title = "National Science Foundation Grant",
#' award_url = "https://www.nsf.gov/awardsearch/showAward?AWD_ID=1656026",
#' funding_description = "BLE LTER is supported by the National Science
#' Foundation under award #1656026
#' (2017-08-01 to 2022-07-31)." )
#' award_url = "https://www.nsf.gov/awardsearch/showAward?AWD_ID=1656026")
#' @export

create_funding <- function(funder_name, award_title, funder_identifier = NULL,
award_number = NULL, award_url = NULL, funding_description = NULL) {
award_number = NULL, award_url = NULL) {

award <- list()
required_arguments <- c("funder_name", "award_title", "funder_identifier",
"award_number", "award_url", "funding_description")
"award_number", "award_url")

missing_argument_index <- which(c(missing(funder_name), missing(award_title),
missing(funder_identifier), missing(award_number),
missing(award_url), missing(funding_description)))
missing(award_url)))

if (length(missing_argument_index) > 0) {
fund_error <- required_arguments[missing_argument_index][1]
Expand Down Expand Up @@ -66,7 +62,7 @@ create_funding <- function(funder_name, award_title, funder_identifier = NULL,
award <- list(funderName = funder_name,
title = award_title)
if (missing(award_url) | missing(award_number) |
missing(funder_identifier) | missing(funding_description)) {
missing(funder_identifier)) {
warning(fund_error_message, call. = FALSE)
}
}
Expand All @@ -78,9 +74,6 @@ create_funding <- function(funder_name, award_title, funder_identifier = NULL,
if (!is.null(award_number)) {
award$awardNumber = award_number
}
if (!is.null(funding_description)) {
award$description = funding_description
}
if (!is.null(award_url)) {
award$awardUrl <- award_url
}
Expand Down
4 changes: 2 additions & 2 deletions R/project-element.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' role = "creator", organization = "USBR")
#' funding_metadata <- list(funder_name = "USBR", funder_identifier = NA, award_number = "R14AC00096",
#' award_title = "Salmonid Spawning and Rearing Habitat Restoration in the Sacramento River",
#' award_url = NA, funding_description = NA)
#' award_url = NA)
#'
#' create_project(project_title, project_lead, funding_metadata)
#' @export
Expand Down Expand Up @@ -47,7 +47,7 @@ create_project <- function(project_title, project_lead, funding_metadata) {
#' role = "creator", organization = "USBR", orcid = NA)
#' funding_metadata <- list(funder_name = "USBR", funder_identifier = NA, award_number = "R14AC00096",
#' award_title = "Salmonid Spawning and Rearing Habitat Restoration in the Sacramento River",
#' award_url = NA, funding_description = NA)
#' award_url = NA)
#'
#' dataset <- list() %>%
#' add_title(list(title = "O.mykiss Habitat monitoring and contact point project", short_name = "O.mykiss monitoring")) %>%
Expand Down
3 changes: 3 additions & 0 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 18 additions & 15 deletions docs/articles/create-EML-from-template.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions docs/articles/template-doc.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions docs/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
pandoc: 2.19.2
pandoc: 3.1.1
pkgdown: 2.0.7
pkgdown_sha: ~
articles:
create-EML-from-template: create-EML-from-template.html
template-doc: template-doc.html
last_built: 2023-04-03T20:23Z
update-data-package: update-data-package.html
last_built: 2023-08-01T16:46Z
urls:
reference: https://CVPIA-OSC.github.io/EMLaide/reference
article: https://CVPIA-OSC.github.io/EMLaide/articles
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/CVPIA_common_species.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/CVPIA_funders.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_abstract.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_access.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_coverage.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_datatable.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_keyword_set.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_license.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_maintenance.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_method.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_other_entity.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/add_personnel.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bb1973d

Please sign in to comment.