[R] creation of a matrix

Erika Ahl erika.ahl at gmail.com
Fri May 8 10:48:29 CEST 2009


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	text_string
3	text_string
.
.
.
n	text_string

I want to create an n x p matrix, n objects (=40) and p unique text
strings. Nij is number of occurrences of a text string j in object i.


What is the most efficient way of creating this matrix?

Best regards,

Erika Ahl




More information about the R-help mailing list