Skip to content

Commit

Permalink
Merge pull request #39 from massimoaria/fix-works2df
Browse files Browse the repository at this point in the history
rbind.data.frame needs same names
  • Loading branch information
massimoaria authored Nov 4, 2022
2 parents 2309251 + ebf4091 commit 2ca73fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/oa2df.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ oa2df <- function(data, entity, abstract = TRUE, count_only = FALSE, group_by =
#' # @export

works2df <- function(data, abstract = TRUE, verbose = TRUE) {

if (!is.null(data$id)) {
data <- list(data)
}
Expand Down Expand Up @@ -179,7 +178,12 @@ works2df <- function(data, abstract = TRUE, verbose = TRUE) {
}
first_inst <- prepend(first_inst, "institution")
aff_raw <- list(au_affiliation_raw = l$raw_affiliation_string[1])
l_author <- if (length(l$author) > 0) prepend(l$author, "au") else list()
l_author <- l_author <- if (length(l$author) > 0) {
prepend(l$author, "au")
} else {
empty_list(c("au_id", "au_display_name", "au_orcid"))
}

c(l_author, l["author_position"], aff_raw, first_inst)
})))

Expand Down

0 comments on commit 2ca73fb

Please sign in to comment.