Skip to content

Commit

Permalink
Extract reference keys in intchron_tabulate() (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeroe committed Oct 20, 2020
1 parent e3abfb7 commit 1df1414
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions R/response.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ intchron_extract <- function(x, what) {
#' @param x A list of IntChron responses.
#'
#' @return
#' A `tibble` combining the data from all responses.
#' A `tibble` combining the data from all responses. Bibliographic references
#' are returned as a list column containing a vector of citation keys (ref: or
#' doi:) for each record.
#'
#' @family functions for interacting with the IntChron API
#'
Expand All @@ -59,7 +61,7 @@ intchron_tabulate <- function(x) {
#' @param header List of metadata from IntChron.
#'
#' @return
#' A data frame.
#' A tibble.
#'
#' @noRd
intchron_tabulate_series <- function(series_list, header) {
Expand All @@ -75,7 +77,9 @@ intchron_tabulate_series <- function(series_list, header) {
data <- cbind(header, data)

# Append references
# TODO
refs <- purrr::pluck(series_list, 1, "refs")
refs <- paste0(refs)
data <- cbind(data, refs = refs)

data <- tibble::as_tibble(data)
return(data)
Expand Down
4 changes: 3 additions & 1 deletion man/intchron_tabulate.Rd

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

0 comments on commit 1df1414

Please sign in to comment.