R: Functions for loading and writing Pajek files

Pajek {blockmodeling} | R Documentation

## Functions for loading and writing Pajek files

### Description

Functions for reading/loading and writing Pajek files:

`loadnetwork` - Loads a Pajek ".net" filename as a matrix. For now, only simple one and two-mode networks are supported (eg. only single relations, no time information).

`loadnetwork2` - The same as above, but adopted to be called withih `loadpajek`

`loadvector` - Loads a Pajek ".clu", ".vec" or ".per" file as a vector.

`loadvector2` - The same as above, but adopted to be called withih `loadpajek` - as a consequence not suited for reading clusters

`loadmatrix` - Loads a Pajek ".mat" file as a matrix.

`loadpajek` - Loads a Pajek project filename (".paj") as a list with the following components: Networks, Partitions, Vectors and Clusters. Clusters and hierarchies are dissmised.

`savevector` - Saves a vector, permutation or partition to a Pajek ".clu", ".vec" or ".per" file.

`savenetwork` - Saves a matrix in to a Pajek ".net" file

`savematrix` - Saves a matrix in to a Pajek ".mat" file

`savecluster` - Saves a vector to a Pajek ".cls" file.

`savepajek` - Saves a list of objects to a Pajek ".paj" file.

### Usage

    loadnetwork(filename,useSparseMatrix=NULL,minN=50)
    loadnetwork2(filename,useSparseMatrix=NULL,minN=50)
    loadmatrix(filename)
    loadvector(filename)
    loadvector2(filename)
    loadpajek(filename)

    savenetwork(n, filename, twomode = "default", symetric = NULL, cont=FALSE)
    savematrix(n, filename, twomode = 1, cont=FALSE)
    savevector(v, filename, cont=FALSE)
    savecluster(v, filename, cont=FALSE)
    savepajek(pajekList,filename,twomode="default",asMatrix=FALSE,symetric=NULL)

### Arguments

`filename` | The name of the filename to be loaded or saved to or an open file object.
`useSparseMatrix` | Should a sparse matrix be use instead of the ordinary one? Sparse matices can only be used if package Matrix is installed. The default `NULL` uses sparsematrices for networks with more that `minN` vertices
`minN` | The minimal number of units in the network to use sparse matrices.
`n` | A matrix representing the network.
`twomode` | 1 for one-mode networks and 2 for two-mode networks. Default sets the argument to 1 for square matrices and to 2 for others.
`symetric` | If true, only the lower part of the matrix is used and the values are interpreted as "Edges", not "Arcs". When used in `savepajek` function it applies to all networks.
`v` | A vector
`cont` | A logical constant indicating if the output should be appended to a file instead of creating a new file. Included so that the function could be used within `savepajek` function. Not intended to be used/set by user.
`pajekList` | A list containing one or more lists with the following names (exact): "Networks", "Partitions", "Vectors", "Permutations" and "Clusters". Each list should contain elements that correspond to Pajek objects ("Networks" matrices and the other lists vectors), meaning that they can be written to Pajek files using the other save* functions . The content is written to Pajek ".paj" file.
`asMatrix` | A logical constant indicating if the networks should be written in matrix format (as in ".mat" file) instead in the network (*Arcslist or *Edgelist) format (as in ".mat" file).

### Value

NULL, a matrix or a vector (see Description)

### Author(s)

Vladimir Batagelj & Andrej Mrvar (most functions), Aleš Žiberna (`loadnetwork`, `loadpajek` and modification of others)

### References

Pajek ( V. Batagelj, A. Mrvar: Pajek - Program for Large Network Analysis. Home page http://vlado.fmf.uni-lj.si/pub/networks/pajek/.

W. de Nooy, A. Mrvar, V. Batagelj: Exploratory Social Network Analysis with Pajek, CUP, January 2005

### See Also

`plot.mat`, `crit.fun`, `opt.par`, `opt.random.par`, `opt.these.par`, `check.these.par`

[Package blockmodeling version 0.1.9 Index]