我正在尝试将一个向量分配为顶点的属性,但没有成功:
# assignment of a numeric value (everything is ok)
g<-set.vertex.attribute(g, 'checked', 2, 3)
V(g)$checked
.
# assignment of a vector (is not working)
g<-set.vertex.attribute(g, 'checked', 2, c(3, 1))
V(g)$checked
查看手册,http://igraph.sourceforge.net/doc/R/attributes.html,似乎不可能实现。有没有什么解决方法?
到目前为止,我能想到的唯一方法是:
将此信息存储在另一个结构中
- 将向量转换为带分隔符的字符串,并将其存储为字符串