mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
Order data before correlating
This commit is contained in:
parent
e9c05fdbab
commit
8e54dacd3d
1 changed files with 4 additions and 0 deletions
|
|
@ -51,6 +51,10 @@ process_correlation <- function(distances, species_ids, gene_ids,
|
|||
by = "species"
|
||||
)
|
||||
|
||||
# Order data by the reference gene's distance to get a monotonic
|
||||
# relation.
|
||||
setorder(data, distance.y)
|
||||
|
||||
r_sum <- r_sum + abs(cor(data[, distance.x], data[, distance.y]))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue