Skip to content

Commit

Permalink
print: column_names
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Oct 10, 2023
1 parent d443bb6 commit 8c472b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: marginaleffects
Title: Predictions, Comparisons, Slopes, Marginal Means, and Hypothesis Tests
Version: 0.15.1.9012
Version: 0.15.1.9013
Authors@R:
c(person(given = "Vincent",
family = "Arel-Bundock",
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Misc:

* Add support for `hypotheses()` to `inferences()`. This changes `FUN` argument name in `hypotheses` to `FUN` to not conflict with `inferences`. Thanks to @Tristan-Siegfried for code contribution #908.
* Support `survival::survreg()`. Thanks to Carlisle Rainey for Report #911.
* `column_names` argument in `print.marginaleffects()` to suppress the printed column names at the bottom of the printout.

## 0.15.1

Expand Down
3 changes: 2 additions & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ print.marginaleffects <- function(x,
ncols = getOption("marginaleffects_print_ncols", default = 30),
style = getOption("marginaleffects_print_style", default = "summary"),
type = getOption("marginaleffects_print_type", default = TRUE),
column_names = getOption("marginaleffects_print_column_names", default = TRUE),
...) {


Expand Down Expand Up @@ -242,7 +243,7 @@ print.marginaleffects <- function(x,
cat(sprintf("Results averaged over levels of: %s",
paste(vg, collapse = ", ")), "\n")
}
if (ncol(x) <= ncols) {
if (ncol(x) <= ncols && isTRUE(column_names)) {
cat("Columns:", paste(colnames(x), collapse = ", "), "\n")
}
if (isTRUE(type) && !is.null(attr(x, "type"))) {
Expand Down

0 comments on commit 8c472b9

Please sign in to comment.