***** To join INSNA, visit http://www.insna.org *****
On 08/23/2015 08:33 AM, Ian McCulloh wrote:
> ***** To join INSNA, visit http://www.insna.org *****
>
> Hello!
>
> I'm doing an SNA project on an organization of about 120 nodes. I am using
> Statnet in R. I want to make an SNA visualization where I only visualize
> the labels for the most central 10 or 20 nodes. Does anyone have some R
> code that does this?
If I understand what you are trying to do, I think the easiest way to
show labels for some verticies and not others is to conditional set
either the vertex label size (label.cex parameter) to zero or the
vertex.label to blank "" for the labels you want to hide using the
ifelse function.
bet<-betweenness(gn)
gplot(gn, label.cex=ifelse(bet>0.5,bet,0) label.col=1,
label=network.vertex.names(gn), vertex.col=2, edge.col=8, vertex.cex=0.5)
or
bet<-betweenness(gn)
gplot(gn, label.cex=node.scale(node.scale(bet)), label.col=1,
label=iflse(bet>0.5,network.vertex.names(gn),""), vertex.col=2,
edge.col=8, vertex.cex=0.5)
>
> For context and example, here is code I have that will allow me to scale
> the node label based on centrality, and I can color the edges gray for
> contrast.
>
> gplot(gn, label.cex=node.scale(node.scale(betweenness(gn))), label.col=1,
> label=network.vertex.names(gn), vertex.col=2, edge.col=8, vertex.cex=0.5)
>
> I'd also be interested in iGraph implementation, but I'm using statnet for
> this project.
>
> Kind Regards,
>
> Ian
>
> _____________________________________________________________________
> SOCNET is a service of INSNA, the professional association for social
> network researchers (http://www.insna.org). To unsubscribe, send
> an email message to [log in to unmask] containing the line
> UNSUBSCRIBE SOCNET in the body of the message.
>
_____________________________________________________________________
SOCNET is a service of INSNA, the professional association for social
network researchers (http://www.insna.org). To unsubscribe, send
an email message to [log in to unmask] containing the line
UNSUBSCRIBE SOCNET in the body of the message.
|