Skip to content

Commit

Permalink
initialize apc to be NA so it will always be a column in the output df
Browse files Browse the repository at this point in the history
  • Loading branch information
trangdata committed Oct 24, 2024
1 parent 55d8fb1 commit f142b01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/oa2df.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ works2df <- function(data, abstract = TRUE, verbose = TRUE,
sim_fields$publication_date <- as.Date(sim_fields$publication_date)
}

author <- venue <- ab <- apc <- NULL
author <- venue <- ab <- NULL

if (!is.null(paper$primary_location)) {
so_info <- paper$primary_location["source"]
Expand Down Expand Up @@ -260,6 +260,7 @@ works2df <- function(data, abstract = TRUE, verbose = TRUE,
}

# Process APC
apc <- NA
if (any(lengths(paper[c("apc_list", "apc_paid")]) > 0)) {
apc_fields <- list(value = NA, currency = NA, value_usd = NA, provenance = NA)
apc <- list(rbind.data.frame(
Expand Down

0 comments on commit f142b01

Please sign in to comment.