Re: [R] creation of a matrix

2009-05-08 Thread jim holtman
Is this what you want: > x <- data.frame(n=sample(10, n, TRUE), text=sample(LETTERS, n, TRUE)) > table(x$text, x$n) 1 2 3 4 5 6 7 8 9 10 A 6 5 2 0 8 1 5 3 6 4 B 2 2 5 2 2 7 5 4 4 5 C 7 4 6 4 3 6 3 6 5 4 D 9 5 1 6 3 1 3 2 6 3 E 2 6

[R] creation of a matrix

2009-05-08 Thread Erika Ahl
Hi all, I have a relative large amount (several thousand rows, but a small amount of unique objects) of data in a format like this: 1 text_string 1 text_string 1 text_string 2 text_string 2 text_string 3 text_string 3 text_string 3 text_string 3