R包 "scholar"/获取文章的引用历史

标签 r google-scholar

我的 R 包有问题 scholar

什么有效:

get_citation_history(SSalzberg)

什么不:

get_article_cite_history(SSalzberg, "any article")

代码:

article <- "Ultrafast and memory-efficient alignment of short DNA sequences to the human genome"
SSalzberg <- "sUVeH-4AAAAJ" (Google Scholar ID)
get_article_cite_history(SSalzberg, article)

错误消息:

Error in min(years):max(years) : result would be too long a vector
In addition: Warning messages:
1: In min(years) : no non-missing arguments to min; returning Inf
2: In max(years) : no non-missing arguments to max; returning -Inf

我不明白该函数上下文中的错误消息,我尝试了另一位作者的另一篇论文,但没有成功。我不知道我在这里缺少什么......谢谢

最佳答案

您必须使用文章 ID,而不是文章标题。获取此信息的最简单方法可能是检索完整的酒吧列表,其中有一个 pubid 列...

library(scholar)
SSalzberg <- "sUVeH-4AAAAJ"
all_pubs <- get_publications(SSalzberg)
## next step is cosmetic -- the equivalent of stringsAsFactors=FALSE
all_pubs <- as.data.frame(lapply(all_pubs,
         function(x) if (is.factor(x)) as.character(x) else x))
w <-grep("Ultrafast",all_pubs$title) ## publication number 3
all_pubs$title[w]
## [1] Ultrafast and memory-efficient alignment of ...
all_pubs$pubid[w] ## "Tyk-4Ss8FVUC"
ch <- get_article_cite_history(SSalzberg,all_pubs$pubid[w])
plot(cites~year,ch,type="b")

关于R包 "scholar"/获取文章的引用历史,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33570390/

相关文章:

Python:如何访问生成器对象中的元素并将它们放入 Pandas 数据框或字典中?

使用 R 检索期刊论文的引用

r - 形状奇怪的 fiddle 情节

r - 从函数中获取对象名称

R - 有没有办法根据另一个具有不同列的数据框设置数据框列顺序

r - Powershell,R,导入Csv,选择对象,导出csv

r - purrr::lift_vd 不适用于某些函数

python - 在 Python 中使用学术模块进行搜索查询期间停止迭代