Skip to content

Commit

Permalink
round weighted total N
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 24, 2023
1 parent b62a9ee commit 9716c6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/report_sample.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ report_sample <- function(data,
}
# define total N, based on weights
if (!is.null(weights)) {
total_n <- sum(as.vector(table(data[[group_by]]))) * mean(data[[weights]], na.rm = TRUE)
total_n <- round(sum(as.vector(table(data[[group_by]]))) * mean(data[[weights]], na.rm = TRUE))
} else {
total_n <- sum(as.vector(table(data[[group_by]])))
}
Expand Down

0 comments on commit 9716c6a

Please sign in to comment.