Possible Duplicate:
Read a Text File into R
I have a custom stopword list which is in a text file separated with newline character.How can I use the that file in my R script?
Code:
my_stopwords <- c(stopwords(),"aint","wanna","gonna",...)
The only problem is I want to read the words from the file instead of hardcoding them like above. My text file looks like this:
"aint"
"wanna"
"gonna"
...
Thanks in advance.
A new-line-separated file could technically be considered a valid CSV file. Try
read.csv()to get the list in as a data.frame. You may want tounlistit or just access the first column to get it in an array like what you have.