Skip to content

Commit

Permalink
#157 and #79
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbeaudette committed Jan 20, 2021
1 parent 7d5e785 commit 1b561ef
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions R/evalGenHz.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand Down

0 comments on commit 1b561ef

Please sign in to comment.