You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This can e handled using column spanners: https://gt.rstudio.com/reference/tab_spanner.html
54
-
#
53
+
# This can be handled using column spanners: https://gt.rstudio.com/reference/tab_spanner.html
54
+
#
55
55
56
56
57
-
#' Display Frequency Table with Colored Cell Backgrounds
57
+
#' Smart Display of Frequency Table with Colored Cell Backgrounds
58
58
#'
59
-
#' Creates a formatted, semi-graphic "heatmap" table display of frequency data with cell backgrounds
60
-
#' colored according to observed frequencies or their residuals from a loglinear model.
61
-
#' This is an S3 generic function with methods for different input types.
59
+
#' `color_table()` creates a formatted, semi-graphic "heatmap" table display of frequency data with cell backgrounds
60
+
#' colored according to observed frequencies or their residuals from a loglinear model. The goal is to provide a
61
+
#' "smart" tabular display of cross-classified frequency data, with some abilities to highlight possibly interesting
62
+
#' patterns or unusual cells.
63
+
#' This is an S3 generic function, providing methods for different input types: `"table"`, `"xtabs"`, `"matrix"`, `"ftable"`, `"structable"` or `"data.frame"`.
62
64
#'
63
65
#' @param x A `"table"`, `"xtabs"`, `"matrix"`, `"ftable"`, `"structable"`, or `"data.frame"` object
64
66
#' @param ... Additional arguments passed to methods
65
67
#'
66
68
#' @details
67
69
#' This function provides a heatmap-style representation of a frequency table,
68
70
#' where background coloring is used to visualize patterns and anomalies in the data.
69
-
#' When shading by residuals (the default), cells with large positive residuals
71
+
#' When shading by _residuals_ (the default), cells with large positive residuals
70
72
#' (more observations than expected) are shaded red, while cells with large negative
71
73
#' residuals (fewer than expected) are shaded blue. This makes it easy to identify
72
74
#' cells that deviate substantially from what would be expected under a given model
73
75
#' (by default, the independence model).
74
76
#'
75
77
#' For multi-way tables (3 or more dimensions), residuals are computed from the
76
-
#' model of complete independence among all factors using \code{\link[MASS]{loglm}},
77
-
#' unless you specify a model using the `model` or `expected` arguments.
78
+
#' model of complete independence among all factors using \code{\link[MASS]{loglm}}.
79
+
#' But you can specify a model using the `model` or `expected` arguments, in a way similar to that provided
80
+
#' by `mosaic.glm()`.
78
81
#' A message is printed showing the chi-squared statistic, degrees of freedom,
0 commit comments