encode_string: Encode a string vector into a set of numeric vectors

Description Usage Arguments Details Value See Also Examples

View source: R/encode_string.R

Description

Computes the distance matrix for a string and then applies multidimensional scaling to this distance matrix.

Usage

1
encode_string(string, method = "osa", k = 2, ...)

Arguments

string

a string vector.

method

the name of the distance metric.

k

the maximum dimension of the space which the string is to be represented in.

Details

The method for computing distance, can be any of the string distance metrics implemented as part of the stringdist package (see stringdist-metrics for a list).

Value

data.frame

See Also

stringdist-metrics

Examples

1
2
a <- c("Berlin", "Hamburg", "München", "Köln") 
encode_string(a, method='cosine', k=3)

sumtxt/datatools documentation built on Jan. 3, 2021, 1:39 a.m.