Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201945

Creating a correlation matrix from a corpus in R

$
0
0

I have a large corpus and I would like to create a correlation matrix for all the terms in the entire corpus. I can find correlations for any given word in the corpus using the following code:

      findAssocs(corp_dtm, terms = "serachword", corlimit = 0.01)

But I would like to plot this data, using the correlations as weights, so I need a matrix with all the correlations. Is there an easy way to do this?

     hello   world   my     name     is     liam

hello   1      .3     .04    .21     .88    .00

world   .3     1

my      .04            1

name    .21                   1

is      .88                           1

liam    .00                                    1

Like this, but all filled in.

Thanks!


Viewing all articles
Browse latest Browse all 201945

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>