2015-11-06 69 views
2

我有一个问题,使用R包scholar[R包 “秀才”/获取的文章

什么工作的引文历史:

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 

我不明白,在职能范围内的错误信息,我想另一篇论文与另一位作者都没有成功。我不知道我在这里失去了什么....谢谢

回答

5

您必须使用文章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") 
+0

只是备案:本文ID只能从学者的网站进行检索。在纸张ID上面的例子将是:TYK-4Ss8FVUC 从: https://scholar.google.com/citations?view_op=view_citation&hl=en&user=sUVeH-4AAAAJ&citation_for_view=sUVeH-4AAAAJ:Tyk-4Ss8FVUC – Joerg

+0

如我显示,你可以从'get_publications()'的结果中提取它... –

+0

...如果这个答案解决了你的问题,我们鼓励你点击复选标记来接受它... –