Usage Arguments Value Note Author(s) Examples
View source: R/customized functions.R
1 | cufu_freqlist(X_fnames, stop_list)
|
X_fnames |
the file names of corpora. |
stop_list |
words that need to be removed out of analysis. |
output a words frequency list
This package is built to simplify the code in the final report of Methods of Corpus Linguistics
Christine Zhao
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## A_fnames <- get_fnames(".../foldername")
## A_flist <- cufu_freqlist(A_fnames,stop_list)
## The function is currently defined as
function(X_fnames, stop_list) {
# build frequency list for target corpus
# [use whitespace as token splitter]
# [drop tokens containing ":", "[", or "]" ]
X_flist <- X_fnames
freqlist(re_token_splitter = r"--[(?xi) \s+ ]--",
re_drop_token = r"--[(?xi) [:\[\]] ]--",
file_encoding = "UTF-8")
# inspecting the top freq. items (after dropping stop words)
# [resorting to concordances when the need arises]
X_flist <- X_flist
drop_types(stop_list)
# return list
return(X_flist)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.