Learn R Programming

network (version 1.0-1)

read.paj: Read a Pajek Project or Network File and Convert to an R 'Network' Object

Description

Return a (list of) network object(s) after reading a corresponding .net or .paj file. The code accepts ragged array edgelists, but cannot currently handle 2-mode, multirelational (e.g. KEDS), or networks with entries for both edges and arcs (e.g. GD-a99m). Also, this archive currently only contains networks under 10,000 nodes. See network, statnet, or sna for more information.

Usage

read.paj(file, verbose = FALSE, debug = FALSE, edge.name = NULL,
    simplify = FALSE)

Arguments

file
the name of the file whence the data are to be read. If it does not contain an absolute path, the file name is relative to the current working directory (as returned by getwd). file can also be
verbose
logical: Should longer descriptions of the reading and coercion process be printed out?
debug
logical: Should very detailed descriptions of the reading and coercion process be printed out? This is typically used to debug the reading of files that are corrupted on coercion.
edge.name
optional name for the edge variable read from the file. The default is to use the value in the project file.
simplify
Should the returned network be simplified as much as possible and saved? The values specifies the name of the file which the data are to be stored. If it does not contain an absolute path, the file name is relative to the current working directory (see

Value

  • read.paj returns a 'network' object (for .net input) or a list of networks (for .paj input). Additional information in the .paj file (like partition information) is attached to the network objects in another higher order list.

See Also

statnet, network, networkdata

Examples

Run this code
require(network)

par(mfrow=c(2,2))

test.net.1 <- read.paj("http://vlado.fmf.uni-lj.si/pub/networks/data/GD/gd98/A98.net")
plot(test.net.1,main=test.net.1$gal$title)

test.net.2 <- read.paj("http://vlado.fmf.uni-lj.si/pub/networks/data/mix/USAir97.net")
plot(test.net.2,main=test.net.2$gal$title)

Run the code above in your browser using DataLab