Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
文本(推特)及其频率在R中的可视化建议_R_Twitter_Data Visualization - Fatal编程技术网

文本(推特)及其频率在R中的可视化建议

文本(推特)及其频率在R中的可视化建议,r,twitter,data-visualization,R,Twitter,Data Visualization,我正在寻找R或R库中的编码示例,以可视化网络图中的单词频率和关系,非常类似于此示例:(我指的不是worldclouds,而是主页上的网络图) 到目前为止,我已经清理了数据,有大约100万行干净的文本,并计算了相关性和词频 如果你能给我一些建议和建议,我将不胜感激 祝你一切顺利, 作为一个初学者,考虑例如: library(quanteda) library(igraph) set.seed(1) txt <- "I am looking for coding examples in R o

我正在寻找R或R库中的编码示例,以可视化网络图中的单词频率和关系,非常类似于此示例:(我指的不是worldclouds,而是主页上的网络图)

到目前为止,我已经清理了数据,有大约100万行干净的文本,并计算了相关性和词频

如果你能给我一些建议和建议,我将不胜感激

祝你一切顺利,
作为一个初学者,考虑例如:<水果挞>
library(quanteda)
library(igraph)
set.seed(1)
txt <- "I am looking for coding examples in R or R-libraries to visualize words frequencies and relations in a network graph, very similar to this example: http://koaning.io/word-clouds.html (I refer not to the worldclouds, but to the network graph on the homepage)

So far I have cleaned the data and have about 1 million rows with clean text and calculated correlations and word frequencies.

I would highly appreciate if you can advise me and give me some tips on that.

All the best, René"
plot(dfm(txt), min.freq=2L)
库(quanteda)
图书馆(igraph)
种子(1)

欢迎来到SO。请将鼠标悬停在R标记上-它要求一个最小的可复制示例;还可以查看R帮助文件(例如,edgelist中的图表,示例部分)。之后,相应地编辑和改进您的问题。一个好的程序通常提供最少的输入数据、所需的输出数据、代码尝试以及所需的包,所有这些都可以在新的/干净的R会话中复制粘贴运行。为什么?它让所有人都更容易跟随和参与,而不用猜测。哇,太棒了。非常感谢你的帮助,卢卡!非常感谢。祝你有美好的一天!
edges <- do.call(rbind, strsplit(tokenize(x=txt, ngrams=2L, conc="_")[[1]], "_"))
g <- graph_from_edgelist(edges, directed = FALSE)
g <- simplify(g)
plot(g, vertex.size=degree(g))