首页 > 解决方案 > `V<-`(`*tmp*`, value = `*vtmp*`) 中的错误:无效索引

问题描述

我在 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 <- 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<-( *tmp*, value = )中的错误*vtmp*:索引无效

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

标签: rbibliography

解决方案


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

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)

地图


推荐阅读