View source: R/create_cooccurrence_matrix.R
create_cooccurrence_matrix | R Documentation |
This function creates a co-occurrence matrix based on one or more
coded sources. Optionally, it plots a heatmap, simply by calling
the stats::heatmap()
function on that matrix.
create_cooccurrence_matrix(
x,
codes = x$convenience$codingLeaves,
plotHeatmap = FALSE
)
x |
The parsed source(s) as provided by |
codes |
The codes to include; by default, takes all codes. |
plotHeatmap |
Whether to plot the heatmap. |
The co-occurrence matrix; a matrix
.
### Get path to example source
examplePath <-
system.file("extdata", package="rock");
### Parse a selection of example sources in that directory
parsedExamples <-
rock::parse_sources(
examplePath,
regex = "(test|example)(.txt|.rock)"
);
### Create cooccurrence matrix
rock::create_cooccurrence_matrix(parsedExamples);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.