eq.star: Create equivalent star network

Description Usage Arguments Value Examples

View source: R/eq.star.R

Description

This function generates the equivalent star network for a given weighted network.

Usage

1
eq.star(net, type = "adjacency", weighted = TRUE)

Arguments

net

A network in the form of adjacency matrix or edge list.

type

Option that indicates the type of the network. "adjacency": adjacency matrix; "edgelist": edge list

weighted

Logical scalar indicating whether the specified network is weigthed or not.

Value

Equivalent star network of the specified network in the form of adjacency matrix or edge list, depending on the "type" initially specified.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
net <- rbind(c(1,2,4),
c(1,3,2),
c(1,5,3),
c(2,1,4),
c(2,4,1),
c(2,6,1),
c(3,1,2),
c(3,2,4),
c(4,2,1),
c(4,5,2),
c(5,2,2),
c(6,5,1))
star <- eq.star(net, type = "edgelist")
centr.betweenness(net)
centr.betweenness(star, directed = FALSE)

hangxiong/wNetwork documentation built on May 17, 2019, 2:28 p.m.