Displaying 5 results from an estimated 5 matches for "word4".
Did you mean:
word
2012 Mar 23
1
how to cluster rows of words in a text file
Hi:
I am trying to cluster the rows of a text file with 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
word...
2009 Nov 03
3
re ading tokens
Greetings,
I am not familiar with processing text in R. Can someone tell me how to
read each line of words as separate elements in a list?
FE, I would like to turn:
word1 word2 word3
word2 word4
into a list of length two with three character elements in the first list
and two elements in the second. I know that this should be easy, but I am a
little confused by the text functions.
Thanks in advance!
--
View this message in context: http://old.nabble.com/reading-tokens-tp26159915p261599...
2011 Sep 26
2
findAssocs()
I am trying to find the math behind the "tm" package findAssocs()
?findAssocs does not say anything besides "association" and "correlate"
Usually entering "findAssocs" at the CLI gives the code for a R
function, but in this case I obtain:
function (x, term, corlimit)
UseMethod("findAssocs", x)
<environment: namespace:tm>
Any ideas?
2010 Dec 30
1
recursively count the words occurrence in the text files
I just can't google for it:
I'm searching for a "bash" "one liner" (awk, perl, or anything) for this:
there are text files, in several directories:
mkdir one
mkdir two
mkdir three
echo "word1 word2 word3" > one/asf.txt
echo "word2 word4, word5" > one/asfcxv saf.txt
echo "word1. word2" > one/dsgsdg.txt
echo "word6, word3!" > two/sdgsd dsf.txt
echo "word6" > two/ergd.txt
echo "asdf, word2" > three/werdf.txt
echo "word7, word8 word9 word10" > three/qwerb erfsd...
2005 Nov 08
0
sorting during xtabs? sorting by "individual" order?
...to be read in to also construct a document-term
matrix -- however, in the same "term-order" to enable
similarity comparisons in a vector space of the
same format.
Let's make a (fake) example:
(1) support function
# directory 1 contains 2 files (F1 & F2):
F1 = c("word4", "word3", "word2")
F2 = c("word1", "word4", "word2")
# directory 2 contains also 2 files (F3 & F4):
F3 = c("word1", "word2", "bla")
F4 = c("word1", "word2", "...