Usage Arguments Value Note Author(s) Examples
View source: R/customized functions.R
1 | cufu_funword(feature,fnames,short_fnames)
|
feature |
featured words in Correspondence analysis |
fnames |
the file names of corpora. |
short_fnames |
the short file names of corpora 'short_names(fnames)' |
words matrix
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 20 21 | ## The function is currently defined as
function(feature,fnames,short_fnames){
# build a data.frame df with in its row names the features
df <- data.frame(row.names = feature)
for (i in 1:length(fnames)) {
fname <- fnames[[i]] # identify i-th filename
short_fname <- short_fnames[[i]] # identify i-th short filename
flist <- freqlist(fname) # build frequency list for file
flist <- flist[feature] # filter that list to just features
df[[short_fname]] <- flist # add column to d named after filename
}
df <- df
as.matrix()
t()
drop_empty_rc()
return(df)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.