[R] tm package - how to transform a TermDocMatrix to a data.frame

From: Filipe Almeida <milheiros_at_gmail.com>
Date: Wed, 12 Dec 2007 00:43:32 +0000


Hi to all,

I'm using the tm package in a Windows machine.

This is my sample:
>tts1 <- TermDocMatrix(tts, weighting="tf-idf")
>typeof(tts1)

[1] "S4"

How can i transform or put the tts1 TermDocMatrix in a simple data.frame or simple matrix. I need to compute some functions. For example, I need to calculate the euclidian distance:
>dist(tts1dist(x, method = "euclidean")

Thanks in advance!

Filipe Almeida

        [[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 12 Dec 2007 - 00:46:53 GMT

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 12 Dec 2007 - 14:00:19 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.