R knn r defines the following functions. Creates a matrix to be used for calculating distances the. Source code for comprehensive weighted color and texture available see the code page.