From 1b561efbc6cba2c88203a6c11c14536e5dbafe19 Mon Sep 17 00:00:00 2001 From: Dylan Beaudette Date: Wed, 20 Jan 2021 11:18:45 -0800 Subject: [PATCH] #157 and #79 --- R/evalGenHz.R | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/R/evalGenHz.R b/R/evalGenHz.R index a00ce0096..1b245b8b4 100644 --- a/R/evalGenHz.R +++ b/R/evalGenHz.R @@ -75,7 +75,8 @@ evalGenHZ <- function(obj, genhz, vars, non.matching.code='not-used', stand=TRUE ) ) - # compute group-wise summaries-- note that text is returned + # leave as data.table for aggregation + # compute group-wise summaries m.summary <- m[, list(mean = mean(value, na.rm = TRUE), sd = sd(value, na.rm = TRUE)), by = c((genhz), 'variable')] # format text @@ -85,14 +86,6 @@ evalGenHZ <- function(obj, genhz, vars, non.matching.code='not-used', stand=TRUE round(m.summary$sd, 2) ) - # # compute group-wise summaries-- note that text is returned - # m.summary <- ddply(m, c(genhz, 'variable'), function(i) { - # stats <- format(paste0(round(mean(i$value, na.rm=TRUE), 2), ' (' , - # sd = round(sd(i$value, na.rm=TRUE), 2), ')'), - # justify = 'right') - # return(data.frame(stats = stats)) - # }) - # using data.table::dcast fm <- paste0(genhz, ' ~ variable') genhz.stats <- dcast(data = m.summary, formula = fm, value.var = 'stats')