【问题标题】:Error in `V<-`(`*tmp*`, value = `*vtmp*`) : invalid indexing`V<-`(`*tmp*`, value = `*vtmp*`) 中的错误:无效索引
【发布时间】:2018-08-17 10:58:59
【问题描述】:

我在 R 中使用了 bibliometrix 函数,想绘制一些有用的图表。

library(bibliometrix)
??bibliometrix
D<-readFiles("E:\\RE\\savedrecs.txt")

M <- convert2df(D,dbsource = "isi", format= "plaintext")
results <- biblioAnalysis(M ,sep = ";" )
S<- summary(object=results,k=10, pause=FALSE)
plot(x=results,k=10,pause=FALSE)
options(width=100)
S <- summary(object = results, k = 10, pause = FALSE)
NetMatrix <- biblioNetwork(M1, analysis = "co-occurrences", network = "author_keywords", sep = ";")

S <- normalizeSimilarity(NetMatrix, type = "association")
net <- networkPlot(S, n = 200, Title = "co-occurrence network",type="fruchterman", labelsize = 0.7, halo = FALSE, cluster = "walktrap",remove.isolates=FALSE, remove.multiple=FALSE, noloops=TRUE, weighted=TRUE)

res <- thematicMap(net, NetMatrix, S)
plot(res$map)

但是在net &lt;- networkPlot(S, n = 200, Title = "co-occurrence network",type="fruchterman", labelsize = 0.7, halo = FALSE, cluster = "walktrap",remove.isolates=FALSE, remove.multiple=FALSE, noloops=TRUE, weighted=TRUE),却显示错误

V&lt;-(*tmp*, value = *vtmp*) 中的错误:索引无效

。我也不能做 CR,它总是显示 unlistCR。我也不能使用 NetMatrix 功能。 一些帮助我plsssssssss

【问题讨论】:

  • 请将代码的开头替换为dput(S) 的输出,有人会通过不可重现的代码并猜测错误原因的可能性很低,您的问题很可能是关闭。
  • @Moody_Mudskipper 感谢您的评论,您的意思是像 dput(S)
  • 不,我的意思是,只需在触发错误的行之前运行dput(S),然后将输出复制到您的问题中
  • 试试x &lt;- c(1,3,7)dput(x),你就会明白它的作用
  • @Moody_Mudskipper 谢谢,但同样的错误仍然存​​在........

标签: r bibliography


【解决方案1】:

问题在于数据本身,而不是您提供的代码。当我从bibliometrix.com 下载数据并在biblioNetwork 函数调用中将M1 更改为M(错字?)时,一切正常。请看下面的代码:

library(bibliometrix)

# Plot bibliometric analysis results
D <- readFiles("http://www.bibliometrix.org/datasets/savedrecs.txt")
M <- convert2df(D, dbsource = "isi", format= "plaintext")
results <- biblioAnalysis(M, sep = ";")
S <- summary(results)
plot(x = results, k = 10, pause = FALSE)

# Plot Bibliographic Network
options(width = 100)
S <- summary(object = results, k = 10, pause = FALSE)
NetMatrix <- biblioNetwork(M, analysis = "co-occurrences", network = "author_keywords", sep = ";")
S <- normalizeSimilarity(NetMatrix, type = "association")
net <- networkPlot(S, n = 200, Title = "co-occurrence network", type = "fruchterman", 
                   labelsize = 0.7, halo = FALSE, cluster = "walktrap",
                   remove.isolates = FALSE, remove.multiple = FALSE, noloops = TRUE, weighted = TRUE)

# Plot Thematic Map
res <- thematicMap(net, NetMatrix, S)
str(M)
plot(res$map)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-12
    • 2018-03-05
    相关资源
    最近更新 更多