what are social networks
play

What are social networks? N ETW ORK AN ALYS IS IN R James - PowerPoint PPT Presentation

What are social networks? N ETW ORK AN ALYS IS IN R James Curley Associate Professor, University of Texas at Austin What are social networks? NETWORK ANALYSIS IN R Network data: adjacency matrix NETWORK ANALYSIS IN R Network data:


  1. What are social networks? N ETW ORK AN ALYS IS IN R James Curley Associate Professor, University of Texas at Austin

  2. What are social networks? NETWORK ANALYSIS IN R

  3. Network data: adjacency matrix NETWORK ANALYSIS IN R

  4. Network data: edgelist NETWORK ANALYSIS IN R

  5. The igraph R package library(igraph) g <- graph.edgelist(as.matrix(df), directed = FALSE) g IGRAPH UN-- 7 7 -- + attr: name (v/c) + edges (vertex names): [1] A--B A--C A--D A--E A--F E--F F--G NETWORK ANALYSIS IN R

  6. V(g) plot(g) + 7/7 vertices, named: [1] A B C D E F G E(g) + 7/7 edges (vertex names): [1] A--B A--C A--D A--E A--F E--F F--G gorder(g) [1] 7 gsize(g) [1] 7 NETWORK ANALYSIS IN R

  7. Let's practice! N ETW ORK AN ALYS IS IN R

  8. Network Attributes N ETW ORK AN ALYS IS IN R James Curley Associate Professor, University of Texas at Austin

  9. Vertex attributes g IGRAPH UN-- 7 7 -- + attr: name (v/c) + edges (vertex names): [1] A--B A--C A--D A--E A--F E--F F--G NETWORK ANALYSIS IN R

  10. Edge attributes NETWORK ANALYSIS IN R

  11. Adding Vertex Attributes Adding Edge Attributes g <- set_vertex_attr( g <- set_edge_attr( g, g, "age", "frequency", value = c( value = c( 20,25,21,23,24,23,22 2,1,1,1,3,2,4 ) ) ) ) vertex_attr(g) edge_attr(g) $name $frequency [1] "A" "B" "C" "D" "E" "F" "G" [1] 2 1 1 1 3 2 4 $age [1] 20 25 21 23 24 23 22 NETWORK ANALYSIS IN R

  12. Adding attributes II graph_from_data_frame(d = edges.df, vertices = vertices.df, directed = FALSE) NETWORK ANALYSIS IN R

  13. Subsetting networks E(g)[[inc('E')]] + 2/7 edges (vertex names): tail head tid hid frequency 4 E A 5 1 1 6 F E 6 5 2 E(g)[[frequency>=3]] + 2/7 edges (vertex names): tail head tid hid frequency 5 F A 6 1 3 7 G F 7 6 4 NETWORK ANALYSIS IN R

  14. Network visualization V(g)$color <- ifelse( V(g)$age > 22, "red", "white" ) plot( g, vertex.label.color = "black" ) NETWORK ANALYSIS IN R

  15. Let's practice! N ETW ORK AN ALYS IS IN R

  16. Network visualization N ETW ORK AN ALYS IS IN R James Curley Associate Professor, University of Texas at Austin

  17. NETWORK ANALYSIS IN R

  18. Styling vertices and edges NETWORK ANALYSIS IN R

  19. Choosing the appropriate layout Minimize edge crossing Do not allow vertices to overlap Make edge lengths as uniform as possible Increase symmetry of the network as much as possible Position more in�uential nodes towards the center NETWORK ANALYSIS IN R

  20. igraph layouts plot(g, layout = layout.fruchterman.reingold(g)) NETWORK ANALYSIS IN R

  21. Let's practice! N ETW ORK AN ALYS IS IN R

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend