read.OCG: Read an OCG Partition File into R

Description Usage Arguments Value Author(s) References Examples

View source: R/OCG_main.R

Description

This function reads in an OCG partition file and converts it into an OCG object for use in R.

Usage

1
read.OCG(file, elfile = NULL, verbose = FALSE, keep.out = FALSE)

Arguments

file

A character string naming the OCG partition file.

elfile

A character string naming the file containing the network that the OCG partition is based upon.

verbose

Logical, whether to print progress to the screen. Defaults to FALSE.

keep.out

Logical, whether to keep the intermediate files written when reading in the OCG partition. Defaults to FALSE.

Value

An object of class OCG, which is a list containing the following elements:

numbers

An integer vector with the number of edges, nodes, and communities.

modularity

An integer number specifying the modularity of the network.

Q

A real number specifying the value of Q generated by the OCG algorithm.

nodeclusters

A data frame consisting of 2 columns; the first contains node names, and the second contains single community IDs for each node. All communities and their nodes are represented, but not necessarily all nodes.

numclusters

A named integer vector. Names are node names and integer values are the number of communities to which each node belongs.

igraph

An object of class igraph. The network is represented here as an igraph object.

edgelist

A character matrix with 2 columns containing the nodes that interact with each other.

clustsizes

A named integer vector. Names are community IDs and integer values indicate the number of nodes that belong in each community.

Author(s)

Alex T. Kalinka alex.t.kalinka@gmail.com

References

Kalinka, A.T. and Tomancak, P. (2011). linkcomm: an R package for the generation, visualization, and analysis of link communities in networks of arbitrary size and type. Bioinformatics 27, 2011-2012.

Examples

1
2
## Read an OCG partition file into R.
## Not run: oc <- read.OCG(file = "OCG_partition.txt", elfile = "network.txt")

alextkalinka/linkcomm documentation built on Feb. 11, 2021, 4:53 a.m.