Skip to content

Commit

Permalink
Fix neuprint_connection_table when 0 connections
Browse files Browse the repository at this point in the history
* closes #135
  • Loading branch information
jefferis committed Sep 29, 2020
1 parent 0af5b09 commit 1d41984
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/connectivity.R
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ neuprint_connection_table <- function(bodyids,
}
d <- neuprint_list2df(nc, return_empty_df = TRUE)
d$weight <- as.integer(d$weight)
d$prepost <- ifelse(prepost=="PRE",0,1)
if(nrow(d)==0) {
d$prepost=integer(length = 0L)
} else {
d$prepost <- ifelse(prepost=="PRE",0,1)
}
if(!is.null(roi)){
d <- d[d$roi%in%roi,]
}
Expand Down

0 comments on commit 1d41984

Please sign in to comment.