justyna - 7 months ago 33

R Question

I want to calculate weighted degree for a network that I am working with. To do so, I want to use the

`degree_w`

`degree_w`

`alpha = 1`

`degree`

`alpha = 0.5`

`alpha = 1.5`

Here is my model:

`library("tnet")`

net <- cbind(c(1,1,2,2,2,3), c(2,3,3,4,5,2), c(2,1,2,1,3,2))

degree_w(net, alpha = 1.0)

node degree output

[1,] 1 2 3

[2,] 2 3 6

[3,] 3 1 2

[4,] 4 0 0

[5,] 5 0 0

> degree_w(net, alpha = 1.5)

node degree output

[1,] 1 2 3

[2,] 2 3 6

[3,] 3 1 2

[4,] 4 0 0

[5,] 5 0 0

degree_w(net, alpha = 0.5)

node degree output

[1,] 1 2 3

[2,] 2 3 6

[3,] 3 1 2

[4,] 4 0 0

[5,] 5 0 0

Answer

Try,

```
degree_w(net, alpha = 1.0,measure="alpha")
```

The documentation isn't the greatest for this function...