[R] dist - memory

Laurent Gautier laurent at cbs.dtu.dk
Fri Jul 27 14:22:46 CEST 2001

Pesl Thomas wrote:
> Dear R friends,
> Is there a formula for the amount of memory, that is needed by dist(), when
> you know the number of columns and rows? Or is there at least an
> approximation?

As stated in the help for 'dist', the distance per row is computed, and
only the lower triangle is stored in a single vector.

Counting 8 bytes per numerical value, the memory used should be close to
8*nrows*nrows/2, upon which one should add the attributes of a dist
object should added (you may want to neglect as the number of rows gets


Laurent Gautier			CBS, Building 208, DTU
PhD. Student			D-2800 Lyngby,Denmark	
tel: +45 45 25 24 85		http://www.cbs.dtu.dk/laurent
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list