tfidf {wactor}R Documentation

Term frequency inverse document frequency

Description

Converts character vector into a term frequency inverse document frequency (TFIDF) matrix

Usage

tfidf(object, .x = NULL)

Arguments

object

Input object containing dictionary (column), e.g., wactor

.x

Text from which the tfidf matrix will be created

Value

A c-style matrix

Examples


## create wactor
w <- wactor(letters)

## use wactor to create tfidf of same vector
tfidf(w, letters)

## using the initial data is the default; so you don't actually have to
## respecify it
tfidf(w)

## use wactor to create tfidf on new vector
tfidf(w, c("a", "e", "i", "o", "u"))

## apply directly to character vector
tfidf(letters)


[Package wactor version 0.0.1 Index]