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:09] – [triad_data1.csv] hkimscilr:social_network_analysis [2019/12/03 16:10] – [triad_data1.csv] hkimscil
Line 167: Line 167:
     geom_point() +          #define first data geometry     geom_point() +          #define first data geometry
     geom_density_tern()     #define second data geometery     geom_density_tern()     #define second data geometery
 +</code>
 +
 +<code>
 +ggtern(data=demodata1, aes(x=Triad1A, y=Triad1B, z=Triad1C)) +      #define data sources
 +    geom_density_tern()                                 #define a data geometery
 +
 +ggtern(data=demodata1, aes(x=T1A, y=T1B, z=T1C)) +              #define data sources
 +    geom_density_tern(aes(fill=..level.., alpha=..level..))     #define a data geometery with an aesthetic    
 +</code>
 +
 +<code>
 +#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
 +    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
 +    guides(color = "none", fill = "none", alpha = "none"                  #we don't want to display legend items
 </code> </code>
  
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