Convert a formula to a named character vector in analogy tasks.

analogy(formula)

Arguments

formula

a formula object that defines the relationship between words using + or - operators.

Value

a named character vector to be passed to similarity().

See also

Examples

analogy(~ berlin - germany + france)
#>  berlin germany  france 
#>       1      -1       1 
analogy(~ quick - quickly + slowly)
#>   quick quickly  slowly 
#>       1      -1       1