I have a matrix of POSIXct objects
library(data.table)
p <- data.table(a=seq(from=ISOdate(2019,1,1,12,0), to=ISOdate(2019,1,2,0,0), by="hours"), b=seq(from=ISOdate(2019,2,1,12,0), to=ISOdate(2019,2,2,0,0), by="hours"))
and I would like to apply graph_from_edgelist(.)
to it. I have tried it directly
library(igraph)
g <- graph_from_edgelist(as.matrix(p[,c("a","b")]))
and this works quickly and without problems. However, doing it this way causes problems down the line (described here), so I tried using the numeric transformation of the POSIX objects:
p$na <- as.numeric(p$a); p$nb <- as.numeric(p$b)
g <- graph_from_edgelist(as.matrix(p[,c("na","nb")]))
This, however, crashes my machine, saying that R requires enormous RAM. Why is this so?