search for: descnum

Displaying 1 result from an estimated 1 matches for "descnum".

2005 Apr 18
2
Very Slow Gower Similarity Function
...#'empty' similarity matrix for (i in 1:OBJ){ for (j in i:OBJ){ ##calculate index vector of non-NA descriptors between objects i and j descvect <- intersect (setdiff (DESCRIPT, DESCRIPT[is.na(mat[i,DESCRIPT])]), setdiff (DESCRIPT, DESCRIPT[is.na (mat[j,DESCRIPT])])) descnum <- length(descvect) # number of valid descr for i~j comparison partialsim <- (1- abs(mat[i,descvect]-mat[j,descvect])/MRANGE[descvect]) smat[i,j] <- smat[j,i] <- sum (partialsim) / descnum } } smat } Thank-you for your time, Tyler -- Tyler Smith PhD Candidate Plant Scie...