2015-11-06 75 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

...如果這個答案解決了你的問題,我們鼓勵你點擊複選標記來接受它... –