net_x_correlation() is the only one of the three motif_periods functions that
requires object2. Its two siblings branch when object2 is missing:
if(!missing(object2)){
net <- list(net, object2)
} else if(manynet::is_longitudinal(net)){
net <- manynet::to_waves(net)
}
net_x_correlation() does not, so net_x_correlation(ison_monks) fails with
"argument "object2" is missing, with no default", although the shared
@description says these net_*() functions "return a numeric vector the
length of the number of networks minus one. E.g., the periods between waves."
Documented behaviour and implemented behaviour must agree, so either the code
or the description has to move.
Decisions to make
- Longitudinal. Follow the siblings and correlate each consecutive pair of
waves, or correlate only the first and last wave? The siblings give
consecutive pairs, which argues for consistency, but a start/end comparison
is the more common question of a correlation specifically.
- Multiplex. Should a multiplex network correlate its layers pairwise?
Neither sibling does this today, so it would make net_x_correlation()
behave unlike the other two on the same input.
- Which cells. The current body sets the diagonal to
NA for a simple
network and the upper triangle to NA for an undirected one, then uses
complete.obs. Whatever branch is added has to apply the same masking to
each pair, and the two networks must be of the same dimensions.
Related
net_x_change(ison_classmates) and net_x_stability(ison_classmates) both
return all-NA, although both return real numbers on ison_monks. Worth
checking in the same pass, since it is the same longitudinal branch.
Found while auditing the package against CONTRIBUTING.
net_x_correlation()is the only one of the threemotif_periodsfunctions thatrequires
object2. Its two siblings branch whenobject2is missing:net_x_correlation()does not, sonet_x_correlation(ison_monks)fails with"argument "object2" is missing, with no default", although the shared
@descriptionsays thesenet_*()functions "return a numeric vector thelength of the number of networks minus one. E.g., the periods between waves."
Documented behaviour and implemented behaviour must agree, so either the code
or the description has to move.
Decisions to make
waves, or correlate only the first and last wave? The siblings give
consecutive pairs, which argues for consistency, but a start/end comparison
is the more common question of a correlation specifically.
Neither sibling does this today, so it would make
net_x_correlation()behave unlike the other two on the same input.
NAfor a simplenetwork and the upper triangle to
NAfor an undirected one, then usescomplete.obs. Whatever branch is added has to apply the same masking toeach pair, and the two networks must be of the same dimensions.
Related
net_x_change(ison_classmates)andnet_x_stability(ison_classmates)bothreturn all-
NA, although both return real numbers onison_monks. Worthchecking in the same pass, since it is the same longitudinal branch.
Found while auditing the package against CONTRIBUTING.