reject: Return a vector rejection for each element in a...

View source: R/matrixFunctions.R

rejectR Documentation

Return a vector rejection for each element in a VectorSpaceModel

Description

Return a vector rejection for each element in a VectorSpaceModel

Usage

reject(matrix, vector)

Arguments

matrix

A matrix or VectorSpaceModel

vector

A vector (or an object coercable to a vector, see project) of the same length as the VectorSpaceModel.

Value

A new matrix or VectorSpaceModel of the same dimensions as 'matrix', each row of which is orthogonal to the 'vector' object.

This is defined simply as 'matrix-project(matrix,vector)', but having a separate name may make for cleaner code.

See 'project' for more details.

Examples

closest_to(demo_vectors,demo_vectors[["man"]])

genderless = reject(demo_vectors,demo_vectors[["he"]] - demo_vectors[["she"]])
closest_to(genderless,genderless[["man"]])


bmschmidt/wordVectors documentation built on June 2, 2022, 3:53 p.m.