to_levels {manynet} | R Documentation |
Modifying network levels
Description
These functions reformat the levels in manynet-consistent network data.
-
to_onemode()
reformats two-mode network data into one-mode network data by simply removing the nodeset 'type' information. Note that this is not the same asto_mode1()
orto_mode2()
. -
to_twomode()
reformats one-mode network data into two-mode network data, using a mark to distinguish the two sets of nodes. -
to_multilevel()
reformats two-mode network data into multimodal network data, which allows for more levels and ties within modes.
If the format condition is not met,
for example to_onemode()
is used on a network that is already one-mode,
the network data is returned unaltered.
No warning is given so that these functions can be used to ensure conformance.
Unlike the as_*()
group of functions,
these functions always return the same class as they are given,
only transforming these objects' properties.
Usage
to_onemode(.data)
to_twomode(.data, mark)
to_multilevel(.data)
Arguments
.data |
An object of a manynet-consistent class:
|
mark |
A logical vector marking two types or modes. By default "type". |
Details
Not all functions have methods available for all object classes. Below are the currently implemented S3 methods:
igraph | matrix | network | tbl_graph | |
to_multilevel | 1 | 1 | 0 | 1 |
to_onemode | 1 | 1 | 0 | 1 |
to_twomode | 1 | 0 | 1 | 1 |
Value
All to_
functions return an object of the same class as that provided.
So passing it an igraph object will return an igraph object
and passing it a network object will return a network object,
with certain modifications as outlined for each function.
See Also
Other modifications:
add_nodes()
,
add_ties()
,
as()
,
correlation
,
from
,
miss
,
reformat
,
split()
,
to_paths
,
to_project
,
to_scope