0

I have a large dataset that contains 30000 data (as a csv file). The data is like this:

dataset <- data.frame(person = c(1331688384,910725927,1479941022,1606882065,1877559309),
dahak = c(9,1,4,3,2))

personid, dahak

1331688384, 9

910725927, 1

1479941022, 4

1606882065, 3

1877559309, 2

I have to calculate the weight of the edges from the dahak list ... If two dahak numbers are equals then weight of this edge is 1, if two dahak numbers are not equals then calculate their difference and the weight is x.

x = 1 - (abs(as.numeric(dahak[j]) - as.numeric(dahak[k])) / 10)

How can i create a weighted network with the personid as nodes and weight as edges? I now i can do that with create a matrix and then using the networkx library in python or statnet library in R, but matrix has 900 million entries! and my laptop can't hold this ... I'm looking for another way.

Community
  • 1
  • 1
omid jahadi
  • 151
  • 1
  • 12
  • The weighted network will also have 900 million edges - how do you expect to hold that if your laptop can't hold the adjacency matrix? What exactly is your desired output? – CDJB Feb 08 '20 at 17:37
  • 1
    Can you be more specific about what the issue/your question is? – AMC Feb 08 '20 at 20:05

0 Answers0