Skip to content

Commit

Permalink
options as new argument in oa_snowball
Browse files Browse the repository at this point in the history
  • Loading branch information
trangdata committed Jul 19, 2023
1 parent 491ae75 commit b278c95
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions R/oa_snowball.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
oa_snowball <- function(identifier = NULL,
...,
id_type = c("short", "original"),
options = list(),
mailto = oa_email(),
endpoint = "https://api.openalex.org",
verbose = FALSE,
Expand All @@ -45,6 +46,7 @@ oa_snowball <- function(identifier = NULL,
base_args <- list(
entity = "works",
output = "tibble",
options = options,
endpoint = endpoint,
mailto = mailto,
verbose = verbose
Expand Down
6 changes: 2 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ replace_w_na <- function(x){
lapply(x, `%||%`, y = NA)
}

subs_na <- function(x, type = c("row_df", "col_df", "flat", "rbind_df", "identical"), prefix = NULL) {
type <- match.arg(type)
subs_na <- function(x, type, prefix = NULL) {
if (length(x) == 0) {
return(NA)
}
Expand All @@ -28,8 +27,7 @@ subs_na <- function(x, type = c("row_df", "col_df", "flat", "rbind_df", "identic
row_df = as.data.frame(replace_w_na(x)),
col_df = tibble::enframe(unlist(x)),
flat = unlist(x),
rbind_df = do.call(rbind.data.frame, lapply(x, replace_w_na)
)
rbind_df = do.call(rbind.data.frame, lapply(x, replace_w_na))
)

if (!is.null(prefix)) {
Expand Down
18 changes: 18 additions & 0 deletions man/oa_snowball.Rd

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

0 comments on commit b278c95

Please sign in to comment.