Skip to content

Commit

Permalink
Merge pull request #143 from ropensci/oa2df-empty
Browse files Browse the repository at this point in the history
Account for empty element in final_res
  • Loading branch information
massimoaria authored Aug 4, 2023
2 parents 71b8715 + 1544f0d commit 7a5d127
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/oa2df.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
#'
#' @export
oa2df <- function(data, entity, count_only = FALSE, group_by = NULL, abstract = TRUE, verbose = TRUE) {
if (length(data) == 0){
return(NULL)
}

if (!is.null(group_by)) {
return(do.call(rbind.data.frame, data))
}
Expand Down

0 comments on commit 7a5d127

Please sign in to comment.