Message-ID: <475FDF3E.90403@statistik.uni-dortmund.de>
Date: 2007-12-12T13:16:46Z
From: Uwe Ligges
Subject: tm package - how to transform a TermDocMatrix to a data.frame
In-Reply-To: <1c285b0b0712111643y1f88a8a3if331baf46cd385ca@mail.gmail.com>
Filipe Almeida wrote:
> 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")
x <- as.matrix(tts1 at Data)
Uwe Ligges
> 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.