Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get publication data from Google Scholar using Google ID #2

Open
AnthonyEbert opened this issue Nov 1, 2018 · 2 comments
Open

Get publication data from Google Scholar using Google ID #2

AnthonyEbert opened this issue Nov 1, 2018 · 2 comments

Comments

@AnthonyEbert
Copy link
Member

No description provided.

@sevvandi
Copy link
Collaborator

sevvandi commented Nov 1, 2018

Hi Rob,

Can you share the code please. @robjhyndman

Thanks,
Sevvandi

@robjhyndman
Copy link

database.csv has four columns: Name,Role,Campus,GS_link. For example, my row is

"HYNDMAN, Rob",Professor,Clayton,https://scholar.google.com/citations?user=vamErfkAAAAJ&hl=en
# Function to create one row data frame for Google citations
get_gcite_stat <- function(Name, Role, Campus, GS_link) {
  if (!is.na(GS_link)) {
    GS_link %>%
      gcite::gcite_url() %>%
      gcite::gcite_citation_index() %>%
      gather(key = "Period", value = "count", -index) %>%
      mutate(Measure = c("Citations", "hindex", "i10index",
                         "Citations_5yr", "hindex_5yr", "i10index_5yr")) %>%
      select(Measure, count) %>%
      spread(Measure, count) %>%
      mutate(Name = Name, Role = Role, Campus = Campus)
  }
}
# Read list of names and GS URLs
rawdata <- read_csv("database.csv")

gcite <- rawdata %>%
  pmap(get_gcite_stat) %>%
  bind_rows() %>%
  select(Name, Role, Campus, everything())

# Order by roles and citations
gcite <- gcite %>%
  mutate(
    Role = factor(Role, levels = c(
      "Assistant Lecturer",
      "Lecturer",
      "Senior Lecturer",
      "Associate Professor",
      "Professor",
      "Emeritus Professor"))
  ) %>%
  arrange(desc(Role), desc(Citations))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants