M2DFunc <- function (x) {
#x[upper.tri(x)]<-0 #此处取下三角则为单向关系
res <- data.frame(
from = rep(row.names(x), dim(x)[2]),
to = rep(colnames(x), each = dim(x)[1]),
weight = as.vector(x),
stringsAsFactors = F
)
请问一下@llb_321,这个函数中构造数据框的时候,为什么用row.names(x)而不是更常见rownames(x),这两个命令有什么不同之处吗?{:4_214:}