Learn R Programming

qdap (version 0.2.5)

dissimilarity: Dissimilarity Statistics

Description

Uses the distance function to calculate dissimilarity statistics by grouping variables.

Usage

dissimilarity(text.var, grouping.var = NULL,
    method = "prop", diag = FALSE, upper = FALSE, p = 2)

Arguments

text.var
A text variable or word frequency matrix object.
grouping.var
The grouping variables. Default NULL generates one word list for all text. Also takes a single grouping variable or a list of 1 or more grouping variables.
method
Distance methods (see dist function). If "prop" (the default) the result is 1 - "binary".
diag
logical. If TRUE returns the diagonals of the matrix. If method = "prop" diagonals will not be returned.
upper
logical. If TRUE returns the upper triangle of the matrix.
p
The power of the Minkowski distance

Value

  • Returns a matrix of dissimilarity values (the agreement between text).

See Also

dist

Examples

Run this code
with(DATA, dissimilarity(state, list(sex, adult)))
with(DATA, dissimilarity(state, person, diag = TRUE))

Run the code above in your browser using DataLab