I've recently been learning text mining with tidytext
.
Today, I encountered the following:
set.seed(2017)
ggraph(bigram_graph, layout="fr") + geom_edge_link() + geom_node_point() +
geom_node_text(aes(label=name), vjust=1, hjust=1)
I've used the set.seed()
function with other functions like sample()
. But here, I don't understand why ggraph
should be used with set.seed()
.
Can anyone help me?
We use a set.seed function because the results vary when performing a random performance. Figuratively speaking, imagine planting seeds. You can sow seeds anywhere in the land. The first seed planted and the second seed planted produce clearly different results. This is because the shape of the stem and the leaf are different. If you use the set.seed function, you will get the same results.