Questions tagged [sna]

Social network analysis (SNA) is the methodical analysis of social networks. Social network analysis views social relationships in terms of network theory, consisting of nodes (representing individual actors within the network) and ties (which represent relationships between the individuals, such as friendship, kinship, organizational position, sexual relationships, etc.)

296 questions
0
votes
1 answer

How do you save textnets (python) to gml / gexf or access dataframe of graph?

I have been using textnets (python) to analyse a corpus. I need to export the resulting graph for further analysis / layout editing in Gephi. Having read the docs I am still confused on how to either save the resulting igraph Graph in the…
Jack Keenan
  • 85
  • 1
  • 5
0
votes
0 answers

How do I compare Odds Ratios from netlogit function on network data in R (QAP)?

My goal is to compare two of the groups I tested in a QAP using netlogit function in the sna package (I have five conditions). I have created confidence intervals as well and can access the standard error through the netlogit function. However, the…
0
votes
0 answers

Matrix heatmap in ggplot not consistent in upper and lower triangles

For some reason, this symmetrized matrix is plotting with either no data in the lower triangle of the heatmap or just a little as shown in the below figure. I can't figure out why it's happening. Any guesses? I've shared the first 100 rows of the…
0
votes
0 answers

I'm missing the ties for the other nodes in my network and I'm unsure why, any help would be much appreciated

My code is the following: D_igraph <- graph_from_data_frame(d = edges, vertices = nodes, directed = FALSE) as.numeric(Strength1) set.graph.attribute(D_igraph, "Strength_of_tie", Strength1) D E(D_igraph)$Strength <- Strength1 plot(D_igraph,…
0
votes
1 answer

Every node in graph must have only 6 neighbors using R

I have a random graph of 10 nodes (possibly there can be more than 1000 nodes). I have write the following code. g <- erdos.renyi.game(10,1,type = "gnp",directed = FALSE) degree(g) [1] 9 9 9 9 9 9 9 9 9 9 The network diagram is as follows. Now,…
Hamid Alvi
  • 43
  • 4
0
votes
0 answers

How to fix the error in QAP test in SNA: Error in fun(dat, ...) : unused arguments

I would like to compare three networks with the same number of nodes. The three networks G1,G2 & G3 have been created using iGraph, and I have transferred them into network objects, which should be recognizable by SNA. However, when I tried to do a…
0
votes
0 answers

Problems plotting on mplleaflet using networkx and Python

I am working on a social network analysis problem where I have a directed graph. Previously I had an issue when I imported the edges to my graph file, but that is solved. However, I ran into another issue when trying to plot the graph on the map…
Jonaash
  • 3
  • 4
0
votes
2 answers

Importing edges to networkx library in Python

I am working on a social network analysis problem where I have a directed graph. I get an issue when I import the edges to my graph file, which for some reason makes it undirected, making it impossible to measure centralities such as in/out degree…
Jonaash
  • 3
  • 4
0
votes
1 answer

Networkx: Raising the labels above the node using position

I am very new to networkx (just started today!): I am using these two links and replicating: This is for creating the network and This is for how I tried adjusting the label positions So mine looks like this: layout =…
hope288
  • 725
  • 12
  • 23
0
votes
1 answer

Keeping Vertex Names when Converting to Edgelist in R

I am trying to convert a sociomatrix (using the sna package in r) into an edgelist, but keeping the vertex names. Unfortunately, I seem to be at a dead end. For context, I'm using the sna package because I need to symmetrize the data, which I am…
0
votes
1 answer

How to convert dataframe with dummy variables into adjacency matrix?

I have a dataframe with multiple dummy variables. df <- data.frame(A=c(1,0,1,0,1),B=c(1,1,1,0,0),C=c(0,1,0,1,1)) Acutually, the number "1" in each row represent the occurrence of varables, thus the dataframe is something like co-occurance…
Zhiliang Lin
  • 309
  • 2
  • 10
0
votes
0 answers

reducing plot margins in grid.arrange

I am trying to reduce horizontal space between figures in grid.arrange. I want to minimize white space as much as possible. The component figures are produced by the gplot function in the sna package, which uses base graphics. This function seems…
tvg
  • 388
  • 2
  • 13
0
votes
1 answer

Linear Threshold Model in R with igraph

I'm trying to implement a function in R that takes a graph object and with two "opinions" present on the same graph, starting at random points, I should study the diffusion patterns. There is a stubbornness (alpha) parameter between [0, 1], and for…
0
votes
1 answer

accessing nodes by name/id in the network package

In the network and sna packages, is there a way to ensure that you reliably access nodes by an arbitrary id/name, and return output using this id/name? It appears that, even if vertex names are explicitly assigned, the packages default to using 1:n…
tvg
  • 388
  • 2
  • 13
0
votes
0 answers

Add Label only for eigenvector>10 in ggplot2

I have the following code for a network graph: network=ggnet2( NOT1, #the network we plot size = NOT1Geig, #node size in eigenvector max_size = 5, #max size of nodes node.alpha = 0.9, #node opacity node.color = Attriregional1,…
Arnom
  • 1
  • 1