Returns the bone connections as an edge list (data.frame) or as an adjacency matrix.
Value
If as_matrix = FALSE, a data.frame with columns from_label,
to_label, and bone_name. If as_matrix = TRUE, a symmetric
logical adjacency matrix.
Examples
sk <- define_skeleton("COCO")
edges <- get_bone_connections(sk)
head(edges)
#> from_label to_label bone_name
#> 1 Neck RShoulder right_clavicle
#> 2 Neck LShoulder left_clavicle
#> 3 RShoulder RElbow right_upper_arm
#> 4 RElbow RWrist right_forearm
#> 5 LShoulder LElbow left_upper_arm
#> 6 LElbow LWrist left_forearm
adj <- get_bone_connections(sk, as_matrix = TRUE)
dim(adj)
#> [1] 18 18