EVOLUTION-MANAGER
Edit File: hamming.distance.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Hamming Distances of Vectors</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for hamming.distance {e1071}"><tr><td>hamming.distance {e1071}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Hamming Distances of Vectors</h2> <h3>Description</h3> <p> If both <code>x</code> and <code>y</code> are vectors, <code>hamming.distance</code> returns the Hamming distance (number of different elements) between this two vectors. If <code>x</code> is a matrix, the Hamming distances between the rows of <code>x</code> are computed and <code>y</code> is ignored. </p> <h3>Usage</h3> <pre> hamming.distance(x, y) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a vector or matrix.</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>an optional vector.</p> </td></tr> </table> <h3>Examples</h3> <pre> 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) hamming.distance(1:3, 3:1) </pre> <hr /><div style="text-align: center;">[Package <em>e1071</em> version 1.7-3 <a href="00Index.html">Index</a>]</div> </body></html>