2

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

その関数のコンテキストでのエラー メッセージを理解できず、別の著者と別の論文を試しましたが成功しませんでした。ここで何が欠けているのかわかりません....ありがとう

4

1 に答える 1

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")
于 2015-11-06T15:49:30.997 に答える