[R] Creating a large matrix

From: Des Callaghan <descall_at_firenet.uk.net>
Date: Mon 06 Jun 2005 - 00:44:42 EST

Dear all,

I have a set of data that is 2 columns wide and 35,000 rows long (see extract below). The first column contains codes for tetrads (2km x 2km squares within NW England) and the second column has the names of moss species present within each tetrad. I wish to convert this into a matrix where rows are labelled by 'Tetrad', columns are labelled by 'Moss species' and each cell contains a 1 or 0 to denote the presence or absence of the moss species within each tetrad. This would be a matrix measuring 796 rows by 417 columns. Am I able to do this within R? I ran into problems trying to do it using the crosstab query in MS Access and the pivot table function on MS Excel because there are too many columns for these software to handle. Thanks very much in advance for any help.

All the best,

Tetrad	Moss species
SD20S	Amblystegium serpens var. serpens
SD20S	Barbula convoluta
SD21S	Brachythecium albicans
SD20J	Brachythecium rutabulum
SD30S	Bryum argenteum
SD20S	Bryum capillare

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jun 06 00:57:23 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:22 EST