These functions reformat tie attributes like their weight or sign:

  • to_unweighted() reformats weighted network data to unweighted network data, with all tie weights removed.

  • to_unsigned() reformats signed network data to unsigned network data keeping just the "positive" or "negative" ties.

If the format condition is not met, for example to_undirected() is used on a network that is already undirected, 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.

to_unsigned(.data, keep = c("positive", "negative"))

to_unweighted(.data, threshold = 1)

to_signed(.data, mark = NULL)

to_weighted(.data, measure = NULL)

Arguments

.data

An object of a {manynet}-consistent class:

  • matrix (adjacency or incidence) from {base} R

  • edgelist, a data frame from {base} R or tibble from {tibble}

  • igraph, from the {igraph} package

  • network, from the {network} package

  • tbl_graph, from the {tidygraph} package

keep

In the case of a signed network, whether to retain the "positive" or "negative" ties.

threshold

For a matrix, the threshold to binarise/dichotomise at.

mark

A mark (logical vector) the length of the ties in the network.

measure

A numeric vector (measure) that will be added as the tie weights to the network. If this is NULL, then the tie weights will be drawn from a Poisson distribution with \(\lambda = 4\).

Value

A tidygraph object modified as explained in the function description, details, or section.

Details

Not all functions have methods available for all object classes. Below are the currently implemented S3 methods:

              data.frame igraph matrix network tbl_graph
to_signed              *      *      *       *         *
to_unsigned            *      *      *       *         *
to_unweighted          *      *      *       *         *
to_weighted                   *              *         *