Learn R Programming

migraph (version 0.7.1)

read: Reading from/writing to external formats

Description

These functions import from and export to UCINET network files.

Usage

read_ucinet(header_file, as = c("igraph", "network", "matrix"))

write_ucinet( object, filename = deparse(substitute(object)), name = deparse(substitute(object)) )

Arguments

header_file

A character string giving the path to the header (.##h) file. If the function is called without a header_file specified, an OS-specific file picker is opened to help users select it.

as

An output class. One of "igraph", "network", or "matrix". By default "igraph".

object

A migraph-consistent object to be exported.

filename

UCINET filename (without ## extension). By default the files will have the same name as the object and be saved to the working directory.

name

name of matrix to be known in UCINET. By default the name will be the same as the object.

Value

By default, read_ucinet() will import into a matrix format, but can be easily coerced from there into other formats.

A pair of UCINET files in V6404 file format (.##h, .##h)

Details

These functions only work with relatively recent UCINET file formats, e.g. type 6406 files. To import earlier UCINET file types, you will need to update them first.

To import multiple matrices packed into a single UCINET file, you will need to unpack them and convert them one by one.

See Also

convert

Examples

Run this code
# NOT RUN {
# import Roethlisberger & Dickson's horseplay game data set:
horseplay <- read_ucinet("WIRING-RDGAM.##h")
# }
# NOT RUN {
# export it again to UCINET under a different name:
write.ucinet(horseplay,"R&D-horseplay")
# }

Run the code above in your browser using DataLab