token_count: Takes a dataframe with columns from cols and counts the...

token_countR Documentation

Takes a dataframe with columns from cols and counts the unique occurrences, returns a data frame with counts.

Description

Takes a dataframe with columns from cols and counts the unique occurrences, returns a data frame with counts.

Usage

token_count(dat_tokens, cols = TOKEN_TOKEN_TYPE_VEC, .groups = "drop", ...)

Arguments

dat_tokens

data frame with columns in cols.

cols

vector of column names. Default token, token_type

.groups

passed to summarize. Default 'drop'

...

not used

Examples


temp_fn <- tempfile()
download.file("https://www150.statcan.gc.ca/n1/pub/37-26-0001/2021001/ODEF_v2.zip",temp_fn)
dat_odef <- readr::read_csv(unz(temp_fn, "ODEF_v2/ODEF_v2.csv"))
toke_odef <- dat_odef |> tokenize_df(col_nms = c('Facility_Name','Facility_Type', 'Authority_Name', 'Full_Addr'), token_types = c('company_name', 'company_name', 'company_name', 'Address'))
toke_odef |> token_count()


csps-efpc/TokenLink documentation built on Feb. 10, 2023, 3:30 a.m.