-
Notifications
You must be signed in to change notification settings - Fork 5
Description
This bug was analysed by @huizezhang-sherry and @gmbecker and the Bug BBQ in 2024 and also by @elinw on the original bug report.
I think a potential solution would be to avoid printing the column headers from matrices/data.frames when all rows are omitted due to the max
argument or the max.print
option. This is consistent with the behaviour for arrays, e.g.
``` r
print(array(dim= c(6, 6, 6)), max =5)
#> [ reached getOption("max.print") -- omitted 6 matrix slice(s) ]
```
(Note the message is misleading here, see #3).
According to ?print.data.frame
, this function
formats the data frame column-by-column, then converts to a character matrix and dispatches to the print method for matrices.
So, without digging too deep, I think a fix for both cases might be implemented by modifying the C function printMatrix
, e.g. changing the logic to skip printing the matrix and just print the message when there are zero rows.
Potential a good issue for someone new to working on C code in base R.