epicontacts icon indicating copy to clipboard operation
epicontacts copied to clipboard

Faulty handling of NA in get_clusters

Open finlaycampbell opened this issue 5 years ago • 0 comments

NA in contact IDs is treated as a single node, resulting in incorrect clustering.

In the example below, 1 -> NA and NA -> 2 is interpreted as a single cluster, when really these NA nodes are most likely different:

> net <- make_epicontacts(data.frame(id = 1:2),
+                         data.frame(from = c(1, NA),
+                                    to = c(NA, 2)))

> get_clusters(net)$linelist
  id cluster_member cluster_size
1  1              1            3
2  2              1            3
3 NA              1            3

finlaycampbell avatar Jan 21 '20 15:01 finlaycampbell