I have a dataset of publication titles and I want to find the corresponding author names for the same, how do I use Rstudio to retrieve the same? I have already retrieved the API key and am using the following code:
get_author_names <- function(title) {
query <- paste0('TITLE-ABS-KEY("', title, '")')
cat("API Query:", query, "\n")
result <- scopus_search(query = query, count = 1)
print(result)
if (!is.null(result$entries) && length(result$entries) > 0) {
# Extract author names
authors <- result$entries[[1]]$`dc:creator`
if (!is.null(authors)) {
cat("Authors:", paste(authors, collapse = ", "), "\n")
return(authors)
} else {
cat("No authors found\n")
return(NULL)
}
} else {
cat("No authors found\n")
return(NULL)
}
}
When I use the above, however, the dc:creator field only comprises of the first author name, even when the article has multiple authors. How do I retrieve names of all the authors?