dist.std.data | R Documentation |
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.
dist.std.data(x, column = TRUE, ...)
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 |
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.
Elvan Ceyhan
dist
, ipd.mat
, and ipd.mat.euc
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.