Node labels in plots
Closed this issue · 1 comments
mohammedsaqr commented
When plotting the dynega network, all nodes come with the redundant ".Ord1" added to each label, I understand the importance of this for some, but for others, it may not be that intuitive, is there a way to remove it, or better use custom node lables.
AlexChristensen commented
Hi @mohammedsaqr,
Because {EGAnet} uses {GGally}'s ggnet2
plotting system, you can easily adjust most plotting parameters: https://briatte.github.io/ggnet/
Here's an example in {EGAnet}:
# Population structure
simulated_population <- dynEGA(
data = sim.dynEGA, level = "population"
# uses simulated data in package
# useful to understand how data should be structured
)
# Plot
plot(simulated_population)
# Update labels
plot(
simulated_population,
node.label = gsub( # or your labels here
".Ord1", "", colnames(
simulated_population$dynEGA$population$network
)
)
)
Using the node.label
argument will update the node labels to your desired labels