-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix max print bug 15027 #175
base: main
Are you sure you want to change the base?
Conversation
src/main/printarray.c
Outdated
int c_pr = c; | ||
if (c > R_print.max) { | ||
c_pr = R_print.max; | ||
r_pr = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should remain set to 0 if r
is 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting the mistake.
so adding a check for r > 0
before setting r_pr
to 1
should be a good fix.
## case: omitting cols, at least one row prints | ||
print(matrix(nrow = 1, ncol = 6), max = 5) | ||
## in R 4.4.0 there should be a warning for ommited rows (NEW BUG) | ||
print(array(dim = c(2, 4, 1)), max = 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a typo in the issue, this is actually:
print(array(dim= c(2, 2, 1)), max = 2)
Alternative Implementation to fix bug https://bugs.r-project.org/show_bug.cgi?id=15027, r-devel/r-dev-day#4
Test cases were originally written by @loreabad6.