mes_cos: Cosine Similarity

Description Usage Arguments Value Examples

Description

Cosine Similarity

Usage

1
2
mes_cos(freq.table, obj = c("normal", "matrix"),
  normalize = c("tf-idf", "none"))

Arguments

freq.table

A Table

obj

Shall a matrix of dataframe be returned

normalize

none or tf-idf

Value

Table or Matrix

Examples

1
2
3
4
5
6
library(tpfuns)
freq.table <- tibble::tibble(
doc_id = c(1,1,1,1,1,2,2,2,2,3,3,3,3),
term   = c("a", "b", "c", "d", "e", "a", "b", "f", "g", "a", "n", "e", "g"),
freq   = c(21,12,58,32,14,21,14,66,14,12,85,100,12))
mes_cos(freq.table)

M-U-UNI-MA/tpfunctions documentation built on May 24, 2019, 7:37 a.m.