Skip to content

dist - memory

2 messages · Pesl Thomas, Laurent Gautier

#
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?

Thomas Pesl
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
1 day later
#
Pesl Thomas wrote:
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
bigger).



Laurent