Skip to content

Commit

Permalink
Hardcode collation example (#268)
Browse files Browse the repository at this point in the history
Closes #266
  • Loading branch information
lionel- authored Jul 30, 2024
1 parent 5bbba33 commit 54e1409
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions R/collate.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
#' @template with
#' @param new `[character(1)]`\cr New collation order
#' @param .local_envir `[environment]`\cr The environment to use for scoping.
#' @examples
#'
#' @section Examples:
#'
#' ```
#' # Modify collation order:
#' x <- c("bernard", "bérénice", "béatrice", "boris")
#'
#' with_collate("fr_FR", sort(x))
#' with_collate("C", sort(x))
#' #> [1] "béatrice" "bérénice" "bernard" "boris"
#'
#' with_collate("C", sort(x))
#' #> [1] "bernard" "boris" "béatrice" "bérénice"
#' ```
#' @export
with_collate <- function(new, code) {
with_locale(c(LC_COLLATE = new), code)
Expand Down
12 changes: 9 additions & 3 deletions man/with_collate.Rd

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

0 comments on commit 54e1409

Please sign in to comment.