epicontacts
epicontacts copied to clipboard
Faulty handling of NA in get_clusters
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