schochastics / signnet

R package for signed networks
https://schochastics.github.io/signnet/
Other
22 stars 6 forks source link

signed_triangles function #2

Closed vlabatut closed 4 years ago

vlabatut commented 4 years ago

This is not a but report, but a feature suggestion :)

It would be nice to have a function that returns the signed triangles, including their class (---, --+, -++, +++) in addition to their counts. You can easily get that by performing a few changes in your signed_triangles function. For instance: cls <- apply(emat, 1, function(v) length(which(v==1))) will give you the class of each triangle, as an integer corresponding to the number positive links in the triangle. If you cbind that to tmat, you get a 4-column matrix containing the triangles as well as their sign class.

schochastics commented 4 years ago

good point. will change this