如何用学者R包来统计一年内被引用次数为零的论文?
我正在使用R中的Scholar软件包来提取引文统计数据。我计划创建一个具有
- PubID或文章标题
- 年
- 的
数据框,我可以使用“ Get_Article_cite_history”的文章来完成本文,但是,我会收到任何一年没有引用的文章的错误,阅读:
data.frame中的错误(年=年,cites = vals):参数暗示 行数不同:13,12
看代码的运行方式,而不是插入“零”,其中给定年没有引用,它将保留一年,但不会保留引用的行,因此导致不同数量的行。
我想简单地运行一个循环,在此循环中,它将进行PubID,获取所有引文信息(年份和cites of Cites),并用0个CITES来说明任何年份,然后将所有内容绑定在一起以构建数据。
任何帮助将不胜感激!
I am using the scholar package in R to extract citation stats. I am planning on creating a data frame that has
- pubID or article title
- year
- number of citations
I am able to do this article by article using 'get_article_cite_history', however, I receive an error for any article in which there is a year without citations, reading:
Error in data.frame(year = years, cites = vals) : arguments imply
differing number of rows: 13, 12
Looking at how the code runs, instead of inserting a "zero" in which there are no citations for a given year, it will keep the year, but will just not keep the row for citation, thus causing the differing number of rows.
I would like to simply run a loop where it will take a pubid, get all the citation information (year and # of cites) and account for any years with 0 cites, and bind everything together to build the data.
Any help would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该做到。下面的代码使用
get_artice_cite_history()
函数中的内部词,但它没有以最初的方式获得数年的数年,而是从周围跨越提供的范围的HREF的最后四位数字中获取了它们数字。这使得引用的年份和数量兼容。由
创建创建上述输出后的以下代码应在所有出版年度中添加,而不会引用。
This should do it. The code below uses the internals from the
get_artice_cite_history()
function, but instead of getting years in the way the function did originally, it gets them from the last four digits of the href that surrounds the span that provides the number. This makes the years and number of citations compatible.Created on 2022-04-11 by the reprex package (v2.0.1)
Adding the following code after creating the output above should add back in all the publication-years with no citations.