Skip to content

Commit

Permalink
clarify 'rank_order' documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chacalle committed Mar 29, 2021
1 parent 8193456 commit 2e8a93d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
13 changes: 9 additions & 4 deletions R/prioritize_dt.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#' Apply `rank_order` priorities to each unique combination of `rank_by_cols`
#' in `dt`.
#' @param rank_order \[`list()`\]\cr
#' Priority order to use when ranking non-unique rows. Each element of
#' `rank_order` corresponds to a column in `dt`. Possible values for each
#' column are '1' (ascending), '-1' (descending) or ordered factor levels when
#' the column is not a numeric. See details for more information.
#' Named \[`list()`\] defining the priority order to use when ranking
#' non-unique rows. Each element of `rank_order` corresponds to a column in
#' `dt`, the prioritization is applied according to the order of elements in
#' `rank_order`. Possible values for each column are '1' (ascending), '-1'
#' (descending) or ordered factor levels when the column is not a numeric. See
#' details for more information.
#' @param quiet \[`logical(1)`\]\cr
#' Whether to print out detailed messages/warnings about possible issues with
#' `rank_order`. Default is 'FALSE'.
Expand All @@ -30,6 +32,9 @@
#' column are defined in the levels, the priority will be NA and a warning
#' printed if `quiet = FALSE`.
#'
#' The order of elements in `rank_order` matters. The more important rules
#' should be placed earlier in `rank_order` so that they are applied first.
#'
#' @examples
#' # preliminary data with only total population
#' dt_total <- data.table::CJ(
Expand Down
13 changes: 9 additions & 4 deletions man/prioritize_dt.Rd

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

0 comments on commit 2e8a93d

Please sign in to comment.