dichotomise PDF Print E-mail

The dichotomise function creates a binary network from a weighted edgelist.

It has two options:

  • edgelist: the input dataset
  • GT: the cut-off parameter. Default is set to 0, so edges/arcs with a weight greater than 0 is set to 1.

Example: Sample data

## Load tnet
library(tnet) 
## Sample data
Imagesample <- rbind(
c(1,2,4),
c(1,3,2),
c(2,1,4),
c(2,3,4),
c(2,4,1),
c(2,5,2),
c(3,1,2),
c(3,2,4),
c(4,2,1),
c(5,2,2),
c(5,6,1),
c(6,5,1))
## Run programme
Imagedichotomise(sample)
   i j w
1  1 2 1
2  1 3 1
3  2 1 1
4  2 3 1
5  2 4 1
6  2 5 1
7  3 1 1
8  3 2 1
9  4 2 1
10 5 2 1
11 5 6 1
12 6 5 1
## Run programme with a different cut-off parameter
Imagedichotomise(sample, GT=2)
  i j w
1 1 2 1
2 2 1 1
3 2 3 1
4 3 2 1

 

Last Updated ( Friday, 19 June 2009 )