From f142b0118131959cc1f09f40e64712d0dc440542 Mon Sep 17 00:00:00 2001 From: let20 Date: Thu, 24 Oct 2024 13:33:12 -0400 Subject: [PATCH] initialize apc to be NA so it will always be a column in the output df --- R/oa2df.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/oa2df.R b/R/oa2df.R index 86a4d45..d295e2e 100644 --- a/R/oa2df.R +++ b/R/oa2df.R @@ -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"] @@ -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(