Document Heat Map: The Definitive Guide

Doc heatmap

The goal is to create a program where two site’s contents can be compared and represent to show their similarities in a heatmap. This is used in professional SEO services.

By using Hierarchical clustering and K mean Clustering, a group of terms has been selected according to their TF. Then it is shown and compared side by side in a form of Document heat map form where the colors represent their TF in that particular document. Seo company can provide more info about document heat map.

Library loaded:

heatmap 1

To download package outside of CRAN archive:

heatmap 2

 “genefilter” package  needed to download in order to plot the heat map.

Loading stopwords files:

heatmap 3

Text Data input:

This line will take every text file (.txt) in a list file, present in the default directory.

lapply function is applied for operations on list objects and returns a list object of same length of original set.  Know from a seo expert.

Creating a Corpus:

heatmap 5

Content Transformation:

Creating Term Doc Matrix:

heatmap 7

Distance Between vectors:

Algorithm used Euclidean distance to measure the distance of each terms in this case.


heatmap 9

 Number of group to visualize

 Creating Clusters, using Ward method.

 Hang= -1 is use to level the output.

K means Clustering:

Plotting the K means

a number of pseudo-randomly-generated numbers, it takes an (arbitrary) integer argument. So we can take any argument, say, 1 or 123 or 300 or 12345 to get the reproducible random numbers. Know more from Seo consultant service.

Row Variance Of An Array:

Calculates variances of each row of an array

Get Indicies For Significant Edges

Get the indicies for the significant edges in a network.

Plotting the heatmap:

heatmap 13

 Theme implementation

 Heat map plotting


 Doc 1                                      Doc2


2 thoughts on “Document Heat Map: The Definitive Guide

  1. I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.

Leave a Reply

Your email address will not be published. Required fields are marked *