Run a custom distance function on an input data matrix
Run a custom distance function on an input data matrix
CustomDistance(my.mat, my.function, ...)
my.mat |
A matrix to calculate distance on |
my.function |
A function to calculate distance |
... |
Extra parameters to my.function |
A distance matrix
Jean Fan
data("pbmc_small") # Define custom distance matrix manhattan.distance <- function(x, y) return(sum(abs(x-y))) input.data <- GetAssayData(pbmc_small, assay.type = "RNA", slot = "scale.data") cell.manhattan.dist <- CustomDistance(input.data, manhattan.distance)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.