-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
234ee7f
commit 0c1dac6
Showing
6 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#' Get Taxomony Source File | ||
#' | ||
#' @param year `<int>` year of rvu source file; default is `2020` | ||
#' | ||
#' @param code `<chr>` Taxonomy code | ||
#' | ||
#' @returns `<tibble>` of search results | ||
#' | ||
#' @examples | ||
#' retrieve_ark(2024, "101Y00000X") | ||
#' | ||
#' @importFrom dplyr mutate | ||
#' @importFrom data.table year | ||
#' @importFrom fuimus search_in_if | ||
#' | ||
#' @autoglobal | ||
#' | ||
#' @export | ||
retrieve_ark <- function(year = 2024, code = NULL) { | ||
|
||
ark <- get_pin("ark_taxonomy") |> | ||
mutate(year = as.character(year(release_date))) | ||
|
||
year <- match.arg( | ||
arg = as.character(year), | ||
choices = as.character(ark[["year"]]), | ||
several.ok = TRUE) | ||
|
||
ark <- search_in_if(ark, ark[["year"]], year) | ||
ark <- search_in_if(ark, ark[["code"]], code) | ||
|
||
return(ark) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Generated by roxyglobals: do not edit by hand | ||
|
||
utils::globalVariables(c( | ||
# <retrieve_ark> | ||
"release_date", | ||
NULL | ||
)) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.