User Tools

Site Tools


r:social_network_analysis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
r:social_network_analysis [2019/12/03 16:11] – [Triad Data Visualizations] hkimscilr:social_network_analysis [2019/12/03 16:14] – [Analysis (vis)] hkimscil
Line 173: Line 173:
     geom_density_tern()                                 #define a data geometery     geom_density_tern()                                 #define a data geometery
  
-ggtern(data=demodata1, aes(x=T1A, y=T1B, z=T1C)) +              #define data sources+ggtern(data=demodata1, aes(x=Triad1A, y=Triad1B, z=Triad1C)) +              #define data sources
     geom_density_tern(aes(fill=..level.., alpha=..level..))     #define a data geometery with an aesthetic         geom_density_tern(aes(fill=..level.., alpha=..level..))     #define a data geometery with an aesthetic    
 </code> </code>
Line 179: Line 179:
 <code> <code>
 #Or you can apply a color gradient to space between the contour lines #Or you can apply a color gradient to space between the contour lines
-ggtern(data=demodata1, aes(x=T1A, y=T1B, z=T1C)) +                          #define data sources +ggtern(data=demodata1, aes(x=Triad1A, y=Triad1B, z=Triad1C)) +               #define data sources 
-    stat_density_tern(aes(fill=..level.., alpha=..level..),geom='polygon') +#now you need to use stat_density_tern+    stat_density_tern(aes(fill=..level.., alpha=..level..),geom='polygon') + #now you need to use stat_density_tern
     scale_fill_gradient2(high = "red") +                                    #define the fill color     scale_fill_gradient2(high = "red") +                                    #define the fill color
     guides(color = "none", fill = "none", alpha = "none"                  #we don't want to display legend items     guides(color = "none", fill = "none", alpha = "none"                  #we don't want to display legend items
 </code> </code>
  
 +<code>
 +ggtern(data=demodata1, aes(x=Triad1A, y=Triad1B, z=Triad1C)) + 
 +    stat_density_tern(aes(fill=..level.., alpha=..level..), geom='polygon') +
 +    scale_fill_gradient2(high = "blue") +  
 +    geom_point() +
 +    theme_showarrows() +
 +    ggtitle("My Favorite Color") +
 +    xlab("Red") + 
 +    ylab("Yellow") +
 +    zlab("Blue") +
 +    guides(color = "none", fill = "none", alpha = "none")
 +</code>
  
 ===== triad_data1.csv ===== ===== triad_data1.csv =====
r/social_network_analysis.txt · Last modified: 2023/11/22 22:02 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki