Hello: Does anyone know if there exists a package that handles methods for [ for dist objects? I would like to access a dist object using matrix notation e.g. dMat = dist(x) dMat[i,j] Thanks in advance to anyone who can point me in the right direction. [[alternative HTML version deleted]]
On Mon, 12 Mar 2007, Sender wrote:> Hello: > > Does anyone know if there exists a package that handles methods for [ for > dist objects? > > I would like to access a dist object using matrix notation > > e.g. > > dMat = dist(x) > dMat[i,j]Try dMat <- as.matrix(dist(x)) Christian *** --- *** Christian Hennig University College London, Department of Statistical Science Gower St., London WC1E 6BT, phone +44 207 679 1698 chrish at stats.ucl.ac.uk, www.homepages.ucl.ac.uk/~ucakche
> Hello:> > > > > > Does anyone know if there exists a package that handles methods for [ > for > > > dist objects? > > > > > > I would like to access a dist object using matrix notation > > > > > > e.g. > > > > > > dMat = dist(x) > > > dMat[i,j] You can use the [[ operator defined for distance matrices currently in package cba, which allows subsetting "dist" objects. (Note that this will move to the new "proxy" package on proximity measures very soon). David