Skip to content

Commit

Permalink
fixes #30
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindhebbali committed Mar 8, 2018
1 parent ce0b5e7 commit daf86e8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/ds-summary-stats.R
Expand Up @@ -52,7 +52,13 @@ ds_summary_stats <- function(data, variable) UseMethod("ds_summary_stats")
#' @export
#'
ds_summary_stats.default <- function(data, variable) {

vary <- enquo(variable)

odata <-
data %>%
pull(!! vary)

sdata <-
data %>%
pull(!! vary) %>%
Expand All @@ -68,8 +74,8 @@ ds_summary_stats.default <- function(data, variable) {
high_val <- ds_rindex(sdata, high)

result <- list(
obs = length(sdata),
missing = sum(is.na(sdata)),
obs = length(odata),
missing = sum(is.na(odata)),
avg = mean(sdata),
tavg = mean(sdata, trim = 0.05),
stdev = sd(sdata),
Expand Down

0 comments on commit daf86e8

Please sign in to comment.