Skip to content

Commit

Permalink
add return values for some funs
Browse files Browse the repository at this point in the history
This was flagged by CRAN and I completely agree with them!
  • Loading branch information
zkamvar committed Feb 27, 2020
1 parent 76f7900 commit bbf39e5
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/age-categories.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#' you want to have after your highest age group. The default is "+" producing
#' e.g. 80+
#'
#' @return a factor representing age ranges, open at the upper end of the range.
#'
#' @export
#' @examples
#'
Expand All @@ -44,8 +46,6 @@
#' table()
#' })
#' }


age_categories <- function(x, breakers = NULL, lower = 0, upper = NULL, by = 10,
separator = "-", ceiling = FALSE, above.char = "+") {

Expand Down
8 changes: 7 additions & 1 deletion R/cfr.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
#' @param conf_level a number representing the confidence level for which to
#' calculate the confidence interval. Defaults to 0.95, representing a 95%
#' confidence interval.
#' confidence interval using [binom::binom.wilson()]
#'
#' @param multiplier The base by which to multiply the output:
#' - `multiplier = 1`: ratio between 0 and 1
Expand All @@ -27,7 +27,13 @@
#' the total value across all groups.
#'
#' @param digits if `mergeCI = TRUE`, this determines how many digits are printed
#'
#' @return a data frame with five columns that represent the numerator,
#' denominator, rate, lower bound, and upper bound.
#'
#' - `attack_rate()`: cases, population, ar, lower, upper
#' - `case_fatality_rate()`: deaths, population, cfr, lower, upper
#'
#' @export
#'
#' @rdname attack_rate
Expand Down
2 changes: 2 additions & 0 deletions R/inline_fun.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ fmt_ci_df <- function(x, e = 3, l = e + 1, u = e + 2, digits = 2, percent = TRUE
#' @param x a data frame
#'
#' @param ... an expression or series of expressions to pass to [dplyr::filter()]
#'
#' @return a one-element character vector of the format "n (%)"
#'
#' @export
#' @examples
Expand Down
1 change: 1 addition & 0 deletions R/relabel_proportions.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#' @param ... a series of keys and values to replace columns that match specific
#' patterns.
#' @export
#' @return a data frame.
#' @author Zhian N. Kamvar
#' @examples
#'
Expand Down
3 changes: 3 additions & 0 deletions R/unite_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#' @param m100 `TRUE` if the result should be multiplied by 100
#' @param percent `TRUE` if the result should have a percent symbol added.
#' @param ci `TRUE` if the result should include "CI" within the braces (defaults to FALSE)
#'
#' @return a modified data frame with merged columns or one additional column
#' representing the estimate and confidence interval
#'
#' @export
#' @examples
Expand Down
2 changes: 2 additions & 0 deletions man/age_categories.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion man/attack_rate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/fmt_count.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/rename_redundant.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/unite_ci.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bbf39e5

Please sign in to comment.