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

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

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

                                          Methods for GXL manipulations in package graph
                                         GXL比起操作方法在包图

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

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

GXL http://www.gupro.de/GXL is "an XML sublanguage designed to be a standard exchange format for graphs".  This document describes tools in the graph package for importing GXL data to R and for
GXL比起http://www.gupro.de/GXL是“设计图标准交换格式的XML子语言”。本文档介绍了在图形包GXL比起数据导入到R和工具


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


参数:fromGXL
currently returns a graphNEL when possible.  This function is based on xmlEventParse with handlers defined in the function NELhandler.  The dump() element of this handler should emit information on all children of nodes and edges; the asGraphNEL() element will return a graphNEL object with weights if child <attr> with name attribute "weights" is present for each edge element.
目前返回graphNEL在可能的情况下。此功能的基础上xmlEventParse在功能NELhandler定义的处理器。此处理程序的元素转储()应发出信息节点和边的所有儿童;的asGraphNEL()元素将返回与重量graphNEL对象,如果孩子<attr>name属性的“砝码”是的提出每个边元素。


参数:toGXL
for an input of class "graphNEL", returns an object of class c("XMLInternalDOM", "XMLOutputStream"); see the example for how to convert this to a text stream encoding XML
输入一个类“graphNEL”,返回一个对象的C类(的“XMLInternalDOM”,“XMLOutputStream”);看到如何转换到一个文本流编码的XML的例子


参数:dumpGXL
returns an R list with all the node, edge, and named attribute information specified in the GXL stream   
返回的R列表与所有的节点,边,并命名为GXL比起流中指定的属性信息


参数:validateGXL
returns silently (invisibly returns the parsed tree) for a DTD-compliant stream, or is otherwise very noisy
回报默默(无形返回解析树),为符合DTD流,或以其他方式很吵


方法----------Methods----------




fromGXL  con = connection: returns a graphNEL based on a parsing of
fromGXL CON =连接:返回一个解析为基础的graphNEL




dumpGXL  con = connection: returns an R list based on a parsing of
dumpGXL CON =连接:返回一个R名单的基础上解析




validateGXL  con = connection: checks the GXL stream against its DTD
validateGXL CON =连接:检查对GXL比起它的DTD流




toGXL  object = graphNEL: creates an XMLInternalDOM representing the graph in GXL
toGXL对象= graphNEL:创建一个XMLInternalDOM代表GXL比起图


注意----------Note----------

At present, toGXL does not return a validating GXL stream because XML package does not properly handle the dtd and namespaces arguments to xmlTree.  This is being repaired.  To fix the stream, add  <!DOCTYPE gxl SYSTEM "http://www.gupro.de/GXL/gxl-1.0.1.dtd">  as second record in the output.
目前,toGXL不返回一个验证GXL比起流,因为XML包不妥善处理,DTD和命名空间参数,以xmlTree。这是正在修理。要解决流,加上 <!DOCTYPE gxl SYSTEM "http://www.gupro.de/GXL/gxl-1.0.1.dtd"> 第二,在输出的记录。

Some structures in a graphNEL and some tags in GXL may not be handled at this time.
GXL比起一些在graphNEL和标签的一些结构可能不会在这个时间处理。


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


Vince Carey &lt;stvjc@channing.harvard.edu&gt;



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


sf <- file(system.file("GXL/simpleExample.gxl", package="graph"))
show(fromGXL(sf))
print(dumpGXL(sf))
close(sf)
#validateGXL(sf)[validateGXL(SF)]
# bad &lt;- file(system.file("GXL/c2.gxl", package="graph"))[坏< - 文件(。系统(“GXL/c2.gxl”,包=“图”))]
# here's how you can check if the GXL is well-formed, if[这里是如何您可以检查是否GXL比起正在形成,如果]
# you have a libxml2-based version of R XML package[你有一个版本的libxml2-R的XML包]
#[]
# try( validateGXL(bad) )[(validateGXL(坏))]
#[]
gR <- new("graphNEL", nodes=letters[1:4], edgeL=list(
a=list(edges=4), b=list(edges=3), c=list(edges=c(2,1)), d=list(edges=1)),
edgemode="directed")
#[]
# following requires that you are using XML bound with recent libxml2[以下要求,您使用的是最近的libxml2的XML绑定]
#[]
#an &lt;- as.numeric[一个< -  as.numeric]
#if (an(libxmlVersion()$major)&gt;=2 &amp;&amp; an(libxmlVersion()$minor)&gt;=4)[((libxmlVersion()为主要)> = 2 &amp;&amp;(libxmlVersion()为未成年人)> = 4)]
## since toGXL returns an XML object, we need to attach the XML[#自toGXL返回一个XML对象,我们需要重视的XML]
## package.[#包。]
library("XML")
cat(saveXML(toGXL(gR)$value()))
wtd <- file(system.file("GXL/kmstEx.gxl", package="graph"))
wtdg <- fromGXL(wtd)
close(wtd)
print(edgeWeights(wtdg))

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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