View source: R/pair_distances.R
pair_distances | R Documentation |
These functions compute distance matrices from a text representation where each row is a document and each column is a feature to measure distance over based on treatment indicator Z
pair_distances(
dat,
Z,
include = c("cosine", "euclidean", "mahalanobis"),
form = "data.frame",
verbose = FALSE
)
dat |
a matrix text representation with rows corresponding to each document in a corpus and columns
that represent summary measures of the text (e.g., word counts, topic proportions, etc.). Acceptable forms include
a valid quanteda |
Z |
a vector of treatment indicators |
include |
Which distances to calculate |
form |
Should the distances be returned as a list of matrices or condensed into a single data frame? |
A matrix showing pairwise distances for all potential matches of treatment and control units under various distance metrics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.