r">10</span>)
termcorrs &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)
termcorrs &lt;- document_term_frequencies(termcorrs, document = <span class="hljs-string">"topic_level_id"</span>, term = <span class="hljs-string">"lemma"</span>)
termcorrs &lt;- document_term_matrix(termcorrs)
termcorrs &lt;- dtm_cor(termcorrs)
termcorrs[lower.tri(termco