Learn R Programming

SpeedReader (version 0.9.1)

calculate_document_pair_distances: Document Distances

Description

Calculate distances between pairs of documents.

Usage

calculate_document_pair_distances(document_term_matrix, document_indicies,
  distance_method = "cosine")

Arguments

document_term_matrix

A sparse matrix object of class "simple_triplet_matrix", or a dense matrix object, with documents as rows and vocabulary entries as columns.

document_indicies

A numeric vector of length two (document_a_row_index, document_b_row_index), or a list object with each entry containing a vector of length two as described above.

distance_method

Can be one of "cosine" or "euclidean". Defaults to "cosine".

Value

A vector of document pair distances