adjacency: Fix bug in density computation

This commit is contained in:
Elias Projahn 2021-12-09 15:02:25 +01:00
parent 8aafcb7555
commit 207fc753a7

View file

@ -11,7 +11,7 @@ adjacency <- function(preset, progress = NULL) {
cached("adjacency", c(species_ids, gene_ids, reference_gene_ids), { cached("adjacency", c(species_ids, gene_ids, reference_gene_ids), {
# Get the virtual distance value with the highest density. # Get the virtual distance value with the highest density.
compute_densest_distance <- function(distances) { compute_densest_distance <- function(distances) {
if (length(distances <= 2)) { if (length(distances) <= 2) {
mean(distances) mean(distances)
} else { } else {
d <- stats::density(distances) d <- stats::density(distances)