Greetings, 

Apologies if this turns out to be a very silly question, but because I am the 
only person learning/using R at my workplace, I have no choice but to ask folks 
here.
I have been using Gsub to change some expressions in my Corpus object. After 
applying the gsub function, say
newCorpus<- gsub("game","war",newCorpus, fixed=TRUE)
an object of class character is returned by the gsub function, as is 
understandable, like so:
[1] this is the text of the 1st document....[1000] this is the text of the 
1000th document.
However, all such text is enclosed as such:
[1] "c(\"this is the text of the 1st document.\", \"\\a\")" ...[1000] "c(\"this 
is the text of the 1000th document.\", \"\\a\")" 
The worst part is that I tried recreating the problem with another example to 
post here, but I face no such problem with the example. So, after banging my 
head against the computer for two days now, I still remain clueless as to why 
this is happening. I was wondering if somebody had an explanation to why this 
happens? That will be very helpful.
The only thing I can think of is that I had initially converted MS word 
documents into txt files, and then imported them using R's plain text reader. 
Could this be the issue?

Thanks.                                           
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to