[R] Binary Matrices

Mark Edmondson-Jones Mark.Edmondson-jones at nottingham.ac.uk
Wed Apr 13 15:50:43 CEST 2005


I'm wanting to perform analysis (e.g. using eigen()) of binary matrices - i.e. matrices comprising 0s and 1s.

For example:

n<-1000
test.mat<-matrix(round(runif(n^2)),n,n)
eigen(test.mat,only.values=T)

Is there a more efficient way of setting up test.mat, as each cell only requires a binary digit?  I imagine R is setting up a structure which could contain n^2 floats.

Thanks in advance for any help.

Regards,
Mark


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.




More information about the R-help mailing list