Skip to content

Commit

Permalink
Merge pull request #109 from natverse/fix/extract_connectivity_df
Browse files Browse the repository at this point in the history
fix breaking change in tibble
  • Loading branch information
jefferis authored Apr 2, 2020
2 parents 41b57f3 + 715922e commit 30498a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/connectivity.R
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,15 @@ extract_connectivity_df <- function(rois, json, postFix = c("pre", "post")){
}
rois <- unique(rois) #this takes care if both the input and output ROIs are same..
roicols <- c(t(outer(rois,postFix, paste, sep=".")))
values <- tibble::as_tibble(as.list(structure(rep(0, length(roicols)), .Names=roicols)))
values <- structure(rep(0L, length(roicols)), .Names=roicols)
for(roi in rois){
thisroicols <- paste0(roi,".",postFix)
if (!is.null(a)){
b <- a[names(a) %in% thisroicols]
values[names(b)] <- b
}
}
values <- tibble::as_tibble(as.list(values))
values
}

Expand Down

0 comments on commit 30498a3

Please sign in to comment.