1 year ago
#172621
Sari
filtered content of corpus by custom function with R
I want to analysis filtered texts by custom function (function with parameters) using R.
I used readlines function to extract my text and I get large list with 258 lists. Then, using VCorpus(VectorSource(files)) I get my corpus with original text, create corpus from vector. I bug here, I want to find way to get corpus filtered or to filter my files before inserting into corpus.
My aim is to deal with the corpus for the rest of my analysis.
This code allow me to analysis the original text, how can I filter the content of my corpus :
filenames <- list.files(getwd(),pattern="*.txt")
files <- lapply(filenames,readLines,warn=FALSE)
docs <- VCorpus(VectorSource(files))
r
tm
corpus
0 Answers
Your Answer