Skip to content

Commit

Permalink
Merge pull request #155 from ropensci/institution-lineage
Browse files Browse the repository at this point in the history
Fix works2df when there are multiple institution lineages
  • Loading branch information
massimoaria authored Aug 29, 2023
2 parents a01718b + b450fe2 commit ff010f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/oa2df.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ works2df <- function(data, abstract = TRUE, verbose = TRUE) {
} else {
first_inst <- empty_inst
}
first_inst$lineage <- paste(first_inst$lineage, collapse = ", ")
first_inst <- prepend(first_inst, "institution")
aff_raw <- list(au_affiliation_raw = l$raw_affiliation_string[1])
l_author <- if (length(l$author) > 0) {
Expand Down
5 changes: 5 additions & 0 deletions R/oa_fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,26 @@ get_next_page <- function(paging, i, res = NULL) {
#' The argument can be one of c("works", "authors", "venues", "institutions", "concepts").
#' If not provided, `entity` is guessed from `identifier`.
#' @param options List. Additional parameters to add in the query. For example:
#'
#' - `select` Character vector. Top-level fields to show in output.
#' Defaults to NULL, which returns all fields.
#' https://docs.openalex.org/how-to-use-the-api/get-single-entities/select-fields
#'
#' - `sort` Character. Attribute to sort by.
#' For example: "display_name" for venues or "cited_by_count:desc" for works.
#' See more at <https://docs.openalex.org/how-to-use-the-api/get-lists-of-entities/sort-entity-lists>.
#'
#' - `sample` Integer. Number of (random) records to return.
#' Should be no larger than 10,000.
#' Defaults to NULL, which returns all records satisfying the query.
#' Read more at <https://docs.openalex.org/how-to-use-the-api/get-lists-of-entities/sample-entity-lists>.
#'
#' - `seed` Integer.
#' A seed value in order to retrieve the same set of random records in
#' the same order when used multiple times with `sample`.
#' IMPORTANT NOTE: Depending on your query, random results with a seed value may change over time due to new records coming into OpenAlex.
#' This argument is likely only useful when queries happen close together (within a day).
#'
#' @param search Character. Search is just another kind of filter, one that all five endpoints support.
#' But unlike the other filters, search does NOT require an exact match.
#' This is particularly useful in author queries because many authors have middle names, which may not exist or do so in a variety of forms.
Expand Down
4 changes: 4 additions & 0 deletions man/oa_fetch.Rd

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

4 changes: 4 additions & 0 deletions man/oa_query.Rd

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

0 comments on commit ff010f6

Please sign in to comment.