dist.std.data {nnspat} | R Documentation |
Interpoint Distance Matrix for Standardized Data
Description
This function computes and returns the distance matrix computed by using the specified distance measure
to compute the distances between the rows of a data matrix which is standardized row or column-wise.
That is, the output is the interpoint distance (IPD) matrix of the rows of the given set of points x
dist
function in the stats
package of the standard R distribution.
The argument column is the logical argument (default=TRUE
) to determine row-wise or column-wise standardization.
If TRUE
each column is divided by its standard deviation, else each row is divided by its standard deviation.
This function is different from the dist
function in the stats
package.
dist
returns the distance matrix in a lower triangular form, and dist.std.data returns in a full matrix
of distances of standardized data set.
... are for further arguments, such as method
and p
, passed to the dist
function.
Usage
dist.std.data(x, column = TRUE, ...)
Arguments
x |
A set of points in matrix or data frame form where points correspond to the rows. |
column |
A logical argument (default is |
... |
Additional parameters to be passed on the |
Value
A distance matrix whose i,j
-th entry is the distance between rows i
and j
of x
, which is
standardized row-wise or column-wise.
Author(s)
Elvan Ceyhan
See Also
dist
, ipd.mat
, and ipd.mat.euc
Examples
n<-20 #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
ipd<-ipd.mat(Y)
range(ipd)
ipd2<-dist.std.data(Y) #distance of standardized data
range(ipd2)
ipd2<-dist.std.data(Y,method="max") #distance of standardized data
range(ipd2)
#############
Y<-matrix(runif(60,0,100),ncol=3)
ipd<-ipd.mat(Y)
range(ipd)
ipd2<-dist.std.data(Y) #distance of standardized data
range(ipd2)