fop_freq_adjust: Adjust frequency for substring occurances

Description Usage Arguments Value Examples

Description

Adjust frequency for substring occurances

Usage

1
fop_freq_adjust(df, group.ind, term.col, count.col)

Arguments

df

The dataframe (output from the unadjusted frequency count)

group.ind

The groups in which each adjustemt should take place (e.g. per document and sentence). This must be an integer vector with the same length as the input table

term.col

The column that contains the terms

count.col

The column that contains teh unadjusted frequencies for the term column

Value

A numeric vector (adjusted frequencies)

Examples

1
2
3
4
5
6
7
8
9
library(tpfuns)
table <- tibble::tibble(
doc_id = c(1, 1, 2, 2),
term = c("property plant and equipment", "property", "fixed asset", "asset"),
count = c(10, 12, 20, 51)
)

table$adjust <- fop_freq_adjust(table, dplyr::group_indices(table, doc_id), "term", "count")
table

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