Fox_Summer
Fox_Summer

Reputation: 149

Cannot Extract the Citation and Index information in R with the 'scholar'

Hello I want to extract the citation, h-index and i10-index from Google Scholar in R with the package 'scholar' but it returns an error. Can you help me fix it? I really appreciate it.

library(scholar)

professors <- data.frame(
  name = c("John Smith", "Jane Doe", "Mike Johnson"),
  school = c("Harvard University", "Stanford University", "MIT")
)

get_citation_info <- function(name, school) {
  query <- paste(name, school, sep = " ")
  result <- scholar(query, pages = 1)
  citation <- result$metrics$citations
  index <- result$metrics$hindex
  return(data.frame(name = name, school = school, citation = citation, index = index))
}

citation_info <- mapply(get_citation_info, professors$name, professors$school, SIMPLIFY = FALSE)
citation_info <- do.call(rbind, citation_info)

enter image description here

Upvotes: 0

Views: 65

Answers (0)

Related Questions