lt;- merge(x, scores, by.x=<span class="hljs-string">"topic_level_id"</span>, by.y=<span class="hljs-string">"doc_id"</span>)
wordnetwork &lt;- subset(x_topics, topic %<span class="hljs-keyword">in</span>% <span class="hljs-number">1</span> &amp; lemma %<span class="hljs-keyword">in</span>% topicterminology[[<span class="hljs-number">1</span>]]$term)
wordnetwork &lt;- cooccurrence(wordnetwork, group = c(<span class="hljs-string">"topic_level_id"</span>), term = <span class="hljs-string">"lemma"</span>)
word