找回密码
 注册
查看: 544|回复: 0

R语言 graph包 graph2SparseM()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 21:09:15 | 显示全部楼层 |阅读模式
graph2SparseM(graph)
graph2SparseM()所属R语言包:graph

                                        Coercion methods between graphs and sparse matrices  
                                         图表和稀疏矩阵之间的胁迫方法

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

These functions provide coercions between objects that inherit from the graph class to sparse matrices from the SparseM package.
这些功能提供了继承graph类SparseM包稀疏矩阵的对象之间的强制。


用法----------Usage----------


graph2SparseM(g, useweights=FALSE)
sparseM2Graph(sM, nodeNames, edgemode=c("directed", "undirected"))




参数----------Arguments----------

参数:g
An instance of the graph class.  
graph类的一个实例。


参数:useweights
A logical value indicating whether to use the edge weights in the graph as values in the sparse matrix.
一个逻辑值,指示是否使用在稀疏矩阵值图的边权重。


参数:sM
A sparse matrix.
稀疏矩阵。


参数:nodeNames
A character vector of the node names.
一个character矢量的节点名称。


参数:edgemode
Specifies whether the graph to be created should have directed (default) or undirected edges.  If undirected, the input matrix sM must be symmetric.
指定要创建的图形是否应该(默认)或无向边。如果无向,输入矩阵sM必须是对称的。


Details

详情----------Details----------

A very simple coercion from one representation to another.
一个非常简单的从一个代表到另一个胁迫。

Currently it is presumed that the matrix is square. For other graph formats, such as bipartite graphs, some improvements will be needed; patches are welcome.
目前,它被假定矩阵是方形的。对于其他图形格式,如二分图,将有所改善;补丁是受欢迎的。


值----------Value----------

graph2SparseM takes as input an instance of a subclass of the graph class and returns a sparse matrix.
graph2SparseM作为输入graph类的子类的一个实例,并返回一个稀疏矩阵。

sparseM2Graph takes a sparse matrix as input and returns an instance of the graphNEL class.  By default, the graphNEL returned will have directed edges.
sparseM2Graph稀疏矩阵作为输入并返回graphNEL类的一个实例。默认情况下,graphNEL返回的有向边。


作者(S)----------Author(s)----------


R. Gentleman



参见----------See Also----------

graph-class, graphNEL-class, and for other conversions, aM2bpG and ftM2adjM
graph-class,graphNEL-class,对其他转换,aM2bpG和ftM2adjM


举例----------Examples----------


  set.seed(123)
  g1 <- randomGraph(letters[1:10], 1:4, p=.3)
  s1 <- graph2SparseM(g1, useweights=TRUE)
  g2 <- sparseM2Graph(s1, letters[1:10], edgemode="undirected")
  ## consistency check[#一致性检查]
  stopifnot(all.equal(g1, g2))

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-2-6 15:12 , Processed in 0.026927 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表