Skip to content

Commit

Permalink
https://github.com/easystats/easystats/issues/404
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed May 16, 2024
1 parent bb37b89 commit ccfdf71
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: insight
Title: Easy Access to Model Information for Various Model Objects
Version: 0.19.11
Version: 0.19.11.1
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# insight 0.19.12

## Breaking

* Arguments named `group_by` will be deprecated in a future release. Please use
`by` instead. This affects `export_table()` in *insight*.

# insight 0.19.11

## General
Expand Down
19 changes: 13 additions & 6 deletions R/export_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#' the second and third, right-align column four and left-align the fifth
#' column. For HTML-tables, may be one of `"center"`, `"left"` or
#' `"right"`.
#' @param group_by Name of column in `x` that indicates grouping for tables.
#' Only applies when `format = "html"`. `group_by` is passed down
#' to `gt::gt(groupname_col = group_by)`.
#' @param by Name of column in `x` that indicates grouping for tables.
#' Only applies when `format = "html"`. `by` is passed down to
#' `gt::gt(groupname_col = group_by)`.
#' @param width Refers to the width of columns (with numeric values). Can be
#' either `NULL`, a number or a named numeric vector. If `NULL`, the width for
#' each column is adjusted to the minimum required width. If a number, columns
Expand All @@ -48,6 +48,7 @@
#' if `table_width` is numeric and table rows are larger than `table_width`,
#' the table is split into two parts.
#' @param ... Currently not used.
#' @param group_by Deprecated, please use `by` instead.
#' @inheritParams format_value
#' @inheritParams get_data
#'
Expand Down Expand Up @@ -116,7 +117,8 @@ export_table <- function(x,
subtitle = NULL,
footer = NULL,
align = NULL,
group_by = NULL,
by = NULL,
group_by = NULL, ## TODO: deprecate later
zap_small = FALSE,
table_width = NULL,
verbose = TRUE,
Expand All @@ -131,6 +133,11 @@ export_table <- function(x,
format <- "markdown"
}

## TODO: deprecate later
if (!is.null(group_by)) {
by <- group_by
}

# validation check
if (is.null(x) || (is.data.frame(x) && nrow(x) == 0) || is_empty_object(x)) {
if (isTRUE(verbose)) {
Expand Down Expand Up @@ -191,7 +198,7 @@ export_table <- function(x,
subtitle = subtitle,
footer = footer,
align = align,
group_by = group_by,
group_by = by,
zap_small = zap_small,
empty_line = empty_line,
indent_groups = indent_groups,
Expand Down Expand Up @@ -263,7 +270,7 @@ export_table <- function(x,
subtitle = attributes(i)$table_subtitle,
footer = t_footer,
align = align,
group_by = group_by,
group_by = by,
zap_small = zap_small,
empty_line = empty_line,
indent_groups = indent_groups,
Expand Down
9 changes: 6 additions & 3 deletions man/export_table.Rd

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

0 comments on commit ccfdf71

Please sign in to comment.