cbs_sing: Concept Based Standardization (cbs)

Description Usage Arguments Value Examples

View source: R/measures.R

Description

Concept Based Standardization (cbs)

Usage

1

Arguments

table

A dataframe with 4 columns (columns need to be in the right order)
column 1: A document identifier
column 2: The concept id
column 3: A term identifier
column 4: The term frequency

Value

A dataframe with showing the cbs for each unique firm-pair for each concept

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library (RFtex)

table <- tibble::tibble(
doc_id = c(1,1,1,1,1,2,2,2,2,3,3,3,3),
con_id = c(1,1,2,2,2,1,1,3,3,1,3,2,3),
term   = c("a", "b", "c", "d", "e", "a", "b", "f", "g", "a", "f", "e", "g"),
freq   = c(21,12,58,32,14,21,14,66,14,12,85,100,12))

con.list <- split(table, dplyr::group_indices(table, con_id))
names(con.list) <- sort(unique(table$con_id))

cbs_sing(con.list[[1]])
lapply(con.list, cbs_sing)

M2UCT/RFtex documentation built on May 25, 2019, 4 a.m.