d = as_embed(demodata, normalize=TRUE)
words = cc("
man, woman,
he, she,
boy, girl,
father, mother,
mom, dad,
China, Japan
")
plot_network(d, words)
p = plot_network(
d, words,
node.group=list(Gender=1:6, Family=7:10, Country=11:12),
node.color=c("antiquewhite", "lightsalmon", "lightblue"),
file="network.png")
plot(p)
unlink("network.png") # delete file for code check
# network analysis with centrality plot (see `qgraph` package)
qgraph::centralityPlot(p, include="all", scale="raw",
orderBy="Strength")
# graphical lasso-estimation of partial correlation matrix
plot_network(
d, words,
index="glasso",
# threshold=TRUE,
node.group=list(Gender=1:6, Family=7:10, Country=11:12),
node.color=c("antiquewhite", "lightsalmon", "lightblue"))
Run the code above in your browser using DataLab