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_article_cite_history(id, pubid) sometimes is not returning #99

Closed
Ruheyan opened this issue Jul 13, 2021 · 3 comments · Fixed by #101
Closed

get_article_cite_history(id, pubid) sometimes is not returning #99

Ruheyan opened this issue Jul 13, 2021 · 3 comments · Fixed by #101
Assignees
Labels

Comments

@Ruheyan
Copy link

Ruheyan commented Jul 13, 2021

get_article_cite_history ( ) is not returning as expected sometimes. For example, if I run

id <- "B7vSqZsAAAAJ"
pubid <- get_publications(id)$pubid
get_article_cite_history(id,pubid[30])

reports error as follow:
Error in data.frame(year = years, cites = vals) :
arguments imply differing number of rows: 24, 23

I guess it is because this paper was not cited immediately(same year/the second year) after publication. Is there any way to sort it out?

Many thanks

@jefferis jefferis self-assigned this Jul 13, 2021
@jefferis jefferis added the bug label Jul 13, 2021
@jefferis
Copy link
Collaborator

Many thanks. You're quite right. This was a consequence of the change in 13fa644 that was designed to catch up with changes in how Google present data. I had forgotten that it is necessary to extract the years from the code from the bars. Related to dd59a23 and 6562f1a.

jefferis added a commit that referenced this issue Jul 13, 2021
* closes #99
* modify test to check this
@Ruheyan
Copy link
Author

Ruheyan commented Jul 14, 2021

Sorry, get_article_cite_history ( ) is still not working. Do you have any suggestions on what I need to do?

@jefferis
Copy link
Collaborator

Restart R and reinstall scholar.

> remotes::install_github('jkeirstead/scholar')
> library(scholar)
> id <- "B7vSqZsAAAAJ"
> pubid <- get_publications(id)$pubid
> get_article_cite_history(id,pubid[30])
   year cites        pubid
1  1998     4 qxL8FJ1GzNcC
2  1999     0 qxL8FJ1GzNcC
3  2000     8 qxL8FJ1GzNcC
4  2001    13 qxL8FJ1GzNcC
5  2002    23 qxL8FJ1GzNcC
6  2003    28 qxL8FJ1GzNcC
7  2004    64 qxL8FJ1GzNcC
8  2005    21 qxL8FJ1GzNcC
9  2006    38 qxL8FJ1GzNcC
10 2007    37 qxL8FJ1GzNcC
11 2008    36 qxL8FJ1GzNcC
12 2009    53 qxL8FJ1GzNcC
13 2010    45 qxL8FJ1GzNcC
14 2011    39 qxL8FJ1GzNcC
15 2012    39 qxL8FJ1GzNcC
16 2013    44 qxL8FJ1GzNcC
17 2014    32 qxL8FJ1GzNcC
18 2015    48 qxL8FJ1GzNcC
19 2016    39 qxL8FJ1GzNcC
20 2017    35 qxL8FJ1GzNcC
21 2018    50 qxL8FJ1GzNcC
22 2019    36 qxL8FJ1GzNcC
23 2020    41 qxL8FJ1GzNcC
24 2021     9 qxL8FJ1GzNcC

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

Successfully merging a pull request may close this issue.

2 participants