Skip to content

Commit

Permalink
Added basic test for disjoint hierarchical structures
Browse files Browse the repository at this point in the history
Related: #106
  • Loading branch information
mitchelloharawild committed Aug 13, 2019
1 parent 2def3c5 commit 82b6701
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/reconciliation.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ build_smat <- function(key_data){
smat <- map(fct, function(x){
mat <- rep(0, length(x)*length(levels(x)))
i <- which(!is.na(x))
if(length(i) == length(x) && length(levels(x)) > 1){
abort("Reconciliation of disjoint hierarchical structures is not yet supported.")
}
j <- as.numeric(x[i])
mat[i + length(x) * (j-1)] <- 1
mat <- matrix(mat, nrow = length(x), ncol = length(levels(x)),
Expand Down

0 comments on commit 82b6701

Please sign in to comment.