Last data update: 2014.03.03

R: is a helper function to load networks from files
load_networkR Documentation

is a helper function to load networks from files

Description

This function allows the user to load the network files. Note that standard igraph functions can be also used.

Usage

load_network(filename_or_df, filename_tax_or_df, edge_weight)

Arguments

filename_or_df

the file containing an undirected list of nodes in tabular format (node1, node2, edge weight)

filename_tax_or_df

an additional file containing taxa information for each node

edge_weight

how to treat the edge weight: 'equal', 'proportional' or 'inverse' (default: equal)

Value

This function return generic igraph objects suitable for use in the SDDE package.

Examples

	## Load a network from files. 
	## Not run: 
		network=load_network('graph.txt','graph_tax.txt','equal')
		info_network(network$g1,network$g2);
	
## End(Not run)
	# We expect the network to be a series of nodes as tab-separated values.
	#
	# Example graph.txt:
	# node1	node2  edge weight	
	# x1	x2	   	1
	# x2	x3		1
	# x3	x6		1
	# x1	x5		1
	# x5	x6		1	
	#
	# Example graph_tax.txt
	# x1	plasmid 
	# x2	plasmid
	# x3	bacteria
	# x4	plasmid
	# x5	bacteria
	# x6	virus

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(SDDE)
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/SDDE/load_network.Rd_%03d_medium.png", width=480, height=480)
> ### Name: load_network
> ### Title: is a helper function to load networks from files
> ### Aliases: load_network
> 
> ### ** Examples
> 
> 	## Load a network from files. 
> 	## Not run: 
> ##D 		network=load_network('graph.txt','graph_tax.txt','equal')
> ##D 		info_network(network$g1,network$g2);
> ##D 	
> ## End(Not run)
> 	# We expect the network to be a series of nodes as tab-separated values.
> 	#
> 	# Example graph.txt:
> 	# node1	node2  edge weight	
> 	# x1	x2	   	1
> 	# x2	x3		1
> 	# x3	x6		1
> 	# x1	x5		1
> 	# x5	x6		1	
> 	#
> 	# Example graph_tax.txt
> 	# x1	plasmid 
> 	# x2	plasmid
> 	# x3	bacteria
> 	# x4	plasmid
> 	# x5	bacteria
> 	# x6	virus
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>