我在R中收到两个意外的tnet函数错误。我的边列表:
Person Event
1 a
2 b
3 c
edgelist <- as.matrix("file.csv")
edgelist_in_igraph <- graph.edgelist(edgelist)
edgelist_in_tnet <- as.tnet(edgeist_in_igraph)
cluster_coefficients <- clustering_local_tm(edgelist_in_tnet)
> error: "max not meaningful for factors"如果我试着让它成为一种模式:
onemode <- projecting_tm(tnet, method="Newman")
>error: "arguments must have same length"有什么想法吗?如果在座的任何人以前使用过tnet,任何示例都会非常有帮助。
发布于 2013-03-14 01:45:10
也许这是个误会,但是
edgelist <- as.matrix("file.csv")没有任何意义。as.matrix将R对象转换为矩阵,它无法从文件中读取数据。我想你想要的可能是
edgelist <- read.csv("file.csv")然后
edgelist_in_igraph <- graph.data.frame(edgelist)https://stackoverflow.com/questions/15369495
复制相似问题