smat: Similarity matrix

Description Usage Arguments Value See Also Examples

View source: R/similarity.R

Description

Create a similarity matrix

Usage

1
smat(x, y, s, byrow = FALSE)

Arguments

x

an object containing the values the similarity matrix should be computed for

y

same as x. If given the union of values in x and y are used, if not the unique values of x are used

s

a vector for filling the matrix. By default producing an identity matrix

byrow

should s fill the matrix by row?

Value

A square matrix with the values of s and row-/colnames of the unique values in {x, y}.

See Also

similarity

Examples

1
2
3
4
5
6
7
smat(1:3)

smat(c("f", "e", "d"), s=c(
	4, 1, 1,
	1, 3, 2,
	1, 2, 3
))

AkselA/R-ymse documentation built on March 21, 2020, 9:52 a.m.