From 09679a5e35b4f2f3d48d6ac9dfbeb45e805d48f7 Mon Sep 17 00:00:00 2001 From: Romain Franconville Date: Mon, 2 Mar 2020 17:15:51 -0500 Subject: [PATCH] Add "upstream" and "downstream" fields in extract_connectivity_df --- R/connectivity.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/connectivity.R b/R/connectivity.R index f57f1b16..b8044bb6 100644 --- a/R/connectivity.R +++ b/R/connectivity.R @@ -478,10 +478,10 @@ extract_connectivity_df <- function(rois, json){ } rois <- unique(rois) #this takes care if both the input and output ROIs are same.. a <- unlist(jsonlite::fromJSON(json)) - roicols <- c(t(outer(rois, c("pre", "post"), paste, sep="."))) + roicols <- c(t(outer(rois, c("pre", "post","upstream","downstream"), paste, sep="."))) values <- tibble::as_tibble(as.list(structure(rep(0, length(roicols)), .Names=roicols))) for(roi in rois){ - thisroicols <- paste0(roi,c(".pre",".post")) + thisroicols <- paste0(roi,c(".pre",".post",".upstream",".downstream")) if (!is.null(a)){ b <- a[startsWith(names(a),paste0(roi,"."))] values[names(b)] <- b