weight: Weight Term Counts from 'term_count'

Description Usage Arguments Value Examples

View source: R/weight.R

Description

Weight term counts from term_count object.

Usage

1
2
3
4
5
6
7
weight(x, weight = "percent", ...)

## S3 method for class 'term_count'
weight(x, weight = "percent", ...)

## S3 method for class 'token_count'
weight(x, weight = "percent", ...)

Arguments

x

A term_count object.

weight

A weight to use. Currently the following are available: "proportion", "percent".

...

ignored

Value

Returns a weighted tibble::tibble object of term counts by grouping variable.

Examples

1
2
3
4
5
6
7
library(dplyr)
data(markers)

weight(markers, "percent") %>%
    arrange(desc(n.words))

weight(markers, 'proportion')

trinker/termco documentation built on Jan. 7, 2022, 3:32 a.m.