search for: file_as_matrix

Displaying 1 result from an estimated 1 matches for "file_as_matrix".

2012 Mar 23
1
how to cluster rows of words in a text file
...kmeans: I load the data as follows file1 <- read.csv("somefile.csv") and the file can be viewed having the following line of words > file1 1 word1 word3 word4 word1 2 word1 word4 word3 word1 3 word4 word2 word4 word3 4 word4 word2 word1 word3 5 word2 word2 word4 word2 file_as_matrix <- as.matrix(file1); Now, I want to apply some clustering algorithm such as kmeans to cluster the rows in the file to get the following output: Cluster1 word1 word3 word4 word1 word1 word4 word3 word1 Cluster2 word4 word2 word4 word3 word4 word2 word1 word3 word2 word2 word4 wo...