[R] filtering out unwanted words in a Term Document Matrix

From: Heiman, Thomas J. <theiman_at_mitre.org>
Date: Wed, 11 May 2011 09:17:27 -0400

Hi Y'all,

I am using the text mining package (tm). I am trying to filter out all of the words in a Term Document Matrix that are not in a list of words that I am interested in. I am using the following code:

z<-tm_intersect(txt.dtm, c("communications", "safety", "climate", "blood", "surface", "cleanliness", "amenities", "monitoring", "staff", "competency", "policy", "procedure", "inconsistency", "physician", "orders", "treatment", "times", "care", "plan", "strategies", "concerns", "meetings", "equipment", "treatment", "options", "delivery", "care", "discharge", "welfare", "violations", "HIPPS", "professionalism", "lack", "boundaries crossing", "transportation", "benefits", "assistance", "beneficiary", "complaint", "grievance", "inquiry", "formal", "data", "processing", "concern", "facility", "abuse", "data", "request", "disruptive", "information", "patient", "discharge", "transfer", "physical", "ethics", "resolution", "professional","reimbursement", "financial", "request", "status", "educational", "material", "forms", "technical", "assistance", "staff", "related", "quality", "care","disruptive","behavior","special","needs","mental","illness","noncompliance","illegal", "immigrant!  ", "abusive", "violent","litigation", "prisoner", "corporate", "lockout", "disposition", "discharge", "reason"))

I get the following error:

  "no applicable method for 'tm_intersect' applied to an object of class "c('TermDocumentMatrix', 'simple_triplet_matrix')" "

What am I doing wrong? I'd greatly appreciate any ideas or thoughts on this!!!! Thank you!!

Thomas Heiman, PhD
Info Systems Eng, Sr
The MITRE Corporation | Center for Enterprise Modernization Office: 703-983-2951 | theiman_at_mitre.org<mailto:theiman_at_mitre.org>

        [[alternative HTML version deleted]]

R-help_at_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. Received on Wed 11 May 2011 - 13:20:15 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 11 May 2011 - 14:00:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive