Skip to content

Commit

Permalink
improve doc
Browse files Browse the repository at this point in the history
ref #126
  • Loading branch information
wibeasley committed Oct 28, 2023
1 parent e1c187f commit 82164f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions R/row.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#' @param threshold_proportion Designates the minimum proportion of columns
#' that have a nonmissing values (within each row) in order to return a sum.
#' Required; defaults to to 0.75.
#' In other words, by default, if less than 75% of the specified
#' cells are missing within a row, the row sum will be `NA`.
#' @param nonmissing_count_name If a non-NA value is passed,
#' a second column will be added to `d` that contains the row's count
#' of nonmissing items among the selected columns.
Expand All @@ -38,23 +40,22 @@
#' @author Will Beasley
#' @importFrom rlang :=
#' @examples
#' library(OuhscMunge) #Load the package into the current R session.
#' mtcars |>
#' row_sum(
#' OuhscMunge::row_sum(
#' columns_to_average = c("cyl", "disp", "vs", "carb"),
#' new_column_name = "engine_sum"
#' )
#'
#' mtcars |>
#' row_sum(
#' OuhscMunge::row_sum(
#' columns_to_average = c("cyl", "disp", "vs", "carb"),
#' new_column_name = "engine_sum",
#' nonmissing_count_name = "engine_nonmissing_count"
#' )
#'
#' if (require(tidyr))
#' tidyr::billboard |>
#' row_sum(
#' OuhscMunge::row_sum(
#' pattern = "^wk\\d{1,2}$",
#' new_column_name = "week_sum",
#' threshold_proportion = .1,
Expand All @@ -67,7 +68,7 @@
#' )
#'
#' tidyr::billboard |>
#' row_sum(
#' OuhscMunge::row_sum(
#' pattern = "^wk\\d$",
#' new_column_name = "week_sum",
#' verbose = TRUE
Expand Down
13 changes: 7 additions & 6 deletions man/row_sum.Rd

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

0 comments on commit 82164f4

Please sign in to comment.