Skip to content

Commit

Permalink
change: set_formatter_type() is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgohel committed Dec 10, 2023
1 parent 7a87ccb commit 81b1472
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: flextable
Type: Package
Title: Functions for Tabular Reporting
Version: 0.9.5.002
Version: 0.9.5.003
Authors@R: c(
person("David", "Gohel", role = c("aut", "cre"),
email = "[email protected]"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
- `summarizor()` don't stop anymore if table only contain discrete columns.
- `as_flextable.data.frame()` supports 'data.table'

## Changes

- Deprecate `set_formatter_type()`.

# flextable 0.9.4

## Issues
Expand Down
5 changes: 4 additions & 1 deletion R/formatters.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ set_formatter <- function(x, ..., values = NULL, part = "body") {
#' formatter functions regarding to column types.
#'
#' This function will be deprecated in favor of the `colformat_*` functions,
#' for example [colformat_double()].
#' for example [colformat_double()]. Note that we want to deprecate the
#' `set_formatter_type()` function, not the `set_formatter()` function.
#' @param fmt_double,fmt_integer arguments used by `sprintf` to
#' format double and integer columns.
#' @param fmt_date,fmt_datetime arguments used by `format` to
Expand All @@ -70,6 +71,8 @@ set_formatter_type <- function(x, fmt_double = "%.03f", fmt_integer = "%.0f",
na_str = "") {
stopifnot(inherits(x, "flextable"))

.Deprecated(msg = "Use `colformat_*()` instead.")

col_keys <- x[["body"]]$col_keys
for (varname in col_keys) {
x <- compose(x = x, j = varname, value = as_paragraph(as_chunk(
Expand Down
3 changes: 2 additions & 1 deletion man/set_formatter.Rd

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

0 comments on commit 81b1472

Please sign in to comment.