Giter VIP home page Giter VIP logo

Comments (1)

gnk02 avatar gnk02 commented on July 18, 2024

I also attach a csv file with the list of authors.
author_table_scholar.csv

The code i use to get the number of publications and the number of citations is the following:

function that gets the scholar id of an author and a range in years and

returns the number of citations of all publications in that range

citations_in_years <- function (id, start_year, end_year) {
pubs_in_range <- get_publications(id) %>% filter(!is.na(year) & year>=start_year & year<=end_year)
sum(pubs_in_range$cites)
}

#returns the number of papers in a given time range
papers_in_years <- function (id, start_year, end_year) {
pubs_in_range <- get_publications(id) %>% filter(!is.na(year) & year>=start_year & year<=end_year)
nrow(pubs_in_range)
}

#add them to author_table
author_table <- author_table %>% rowwise() %>%
mutate(num_of_papers_2016_2020=papers_in_years(scholar_id,2016,2020),
cites_of_papers_2016_2020=citations_in_years(scholar_id,2016,2020))

Unfortunately I'm calling get_publications twice but i couldn't do it another way with mutate.

from scholar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.