关系网络图(igraph)-1
2016-03-26 16:08
381 查看
1.添加或删除节点
vertex()和vertices()
函数通过”+”增加节点,没有命名的参数作为新节点的节点名称,命名的参数作为新节点的节点属性;
函数通过”-“删除节点,要删除的节点用c()传递
2.添加或删除关系
edge()和edges()
edge是edges()函数的别名,当增加一个节点时用edge()函数
“bar”和”foo”有关系;”foobar2”和”bar2”有关系
3.增加路径节点
path()
这里的path()里面的节点关系为:依次有向关系,
4.注意以下三种用法
graph <- “foo” + make_empty_graph()
graph <- “foo” + “bar” + make_empty_graph()
graph <- “foo” + ( “bar” + make_empty_graph() )
graph <- make_empty_graph() + “foo” + “bar”
第二种会产生错误
vertex()和vertices()
函数通过”+”增加节点,没有命名的参数作为新节点的节点名称,命名的参数作为新节点的节点属性;
函数通过”-“删除节点,要删除的节点用c()传递
g <- make_empty_graph() + vertices(letters[1:10]) + vertices("foo", "bar", "bar2", "foobar2") plot(g)
2.添加或删除关系
edge()和edges()
edge是edges()函数的别名,当增加一个节点时用edge()函数
g <- g+edge("a","b") g <- g + edges("foo", "bar", "bar2", "foobar2") g <- g + edges(c("bar", "foo", "foobar2", "bar2"), color="red", weight=1:2)
“bar”和”foo”有关系;”foobar2”和”bar2”有关系
3.增加路径节点
path()
g <- make_empty_graph() + vertices(letters[1:10]) g <- g + path("a", "b", "c", "d") g <- g + path("e", "f", "g", weight=1:2, color="red") g <- g + path(c("f", "c", "j", "d"), width=1:3, color="green")
这里的path()里面的节点关系为:依次有向关系,
4.注意以下三种用法
graph <- “foo” + make_empty_graph()
graph <- “foo” + “bar” + make_empty_graph()
graph <- “foo” + ( “bar” + make_empty_graph() )
graph <- make_empty_graph() + “foo” + “bar”
第二种会产生错误
相关文章推荐
- BZOJ_P3651 网络通信(LinkCutTree)
- 笔试总结——计算机网络篇【持续更新】
- 20159320《网络攻防实践》第4周教材学习总结
- ADCD 1.9 ZOS 配置 CTCI-W32 TCPIP 网络
- CentOS 7 下安装 SVN (HTTPS + SSH)
- 借助matlab神经网络工具箱实现蠓虫分类
- Cocoa Touch(五):网络请求 NSURLSession/AFNetworking, GCD, NSURLResquest
- VirtualBox中centos网络配置
- HttpClient抓取网页返回乱码的解决办法
- 防御型体系:一种新的网络安全体系架构
- 使用HttpURLConnection 与 sae 进行数据交互
- HTTP Servlet 重要的几个方法
- TCP/IP 协议详解
- Kubernetes网络配置方案
- $POST 、$HTTP_RAW_POST_DATA、php://input三者之间的区别
- 最详细的Log4j使用教程-http://www.codeceo.com/article/log4j-usage.html
- Okhttp封装、网络层扩展
- 获取手机网络连接状态
- 【BZOJ3651】网络通信
- 【PA2014】【BZOJ3716】Muzeum