[R] hamming distance

JeeBee JeeBee at troefpunt.nl
Thu Nov 24 16:44:05 CET 2005


You could install.packages("e1071")
and see help("hamming.distance")

JeeBee.


hamming.distance            package:e1071            R Documentation
Hamming Distances of Vectors
Description:
     If both 'x' and 'y' are vectors, 'hamming.distance' returns the
     Hamming distance (number of different bytes) between this two
     vectors. If 'x' is a matrix, the Hamming distances between the
     rows of 'x' are computed and 'y' is ignored.
Usage:
      hamming.distance(x, y)
Arguments:
       x: a vector or matrix.
       y: an optional vector.
Examples:
     x <- c(1, 0, 0)
     y <- c(1, 0, 1)
     hamming.distance(x, y)
     z <- rbind(x,y)
     rownames(z) <- c("Fred", "Tom")
     hamming.distance(z)


On Thu, 24 Nov 2005 11:33:45 +0100, Ana Conesa wrote:

> 
>    Hi,
>    Does anyone know an R function to impute hamming distance?
>    Thanks
>    Ana
> 
>       O@@@@@  &nb     @@@O@@O@   Centro de Genómica
>      @O@@@@O@   Instituto Valenciano de Investigaciones Agrarias (IVIA)
>      @@@O@@@@   Carretera Moncada - Naquera, Km. 4,5
>       @@@@O@    46113 Moncada (Valencia) SPAIN
>         ||  &        ||  &
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list