From 1529acad5230207e3b4711202509bc5e9411076b Mon Sep 17 00:00:00 2001 From: timelyportfolio Date: Sun, 23 Apr 2017 20:04:18 -0500 Subject: [PATCH] fix bug in d3_nest by actually only taking first na child --- R/hierarchy.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/hierarchy.R b/R/hierarchy.R index ee5242d..2fd883f 100644 --- a/R/hierarchy.R +++ b/R/hierarchy.R @@ -33,7 +33,7 @@ promote_na_one <- function(x){ na_child <- x$children[[1]][na_child_loc,] x <- dplyr::bind_cols( x, - na_child[,setdiff(colnames(na_child),c("name","children","colname"))] + na_child[1,setdiff(colnames(na_child),c("name","children","colname"))] ) # eliminate na child