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
Solve the knitr auto-printing problem by registering a method for knit_print (#6589)
* Respect shouldPrint when auto-printing from knitr
Implementing a method for the knitr::knit_print generic makes it
possible to customise the behaviour without looking up the call stack.
The current solution only works on R >= 3.6.0 because that's where
delayed S3 registration has been introduced.
* Delay S3method(knit_print, data.table) for R < 3.6
Use setHook() to ensure that registerS3method() will be called in the
same session if 'knitr' is loaded later. Not needed on R >= 3.6.0 where
S3method(knitr::knit_print) will do the right thing by itself.
* ws-only style
* put setHook() in a branch
* Position comment on the same line
* Restore the still-required #2369 condition
* Regression test for #2369
Avoid breaking it again like in #6589
* NEWS entry
* Comment the .onLoad condition
Co-authored-by: Michael Chirico <[email protected]>
* restore unconditional setHook()
---------
Co-authored-by: Michael Chirico <[email protected]>
Copy file name to clipboardExpand all lines: NEWS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,8 @@ rowwiseDT(
115
115
116
116
14. Added a `data.frame` method for `format_list_item()` to fix error printing data.tables with columns containing 1-column data.frames, [#6592](https://github.com/Rdatatable/data.table/issues/6592). Thanks to @r2evans for the bug report and fix.
117
117
118
+
15. The auto-printing suppression in `knitr` documents is now done by implementing a method for `knit_print` instead of looking up the call stack, [#6589](https://github.com/Rdatatable/data.table/pull/6589). Thanks to @jangorecki for the report [#6509](https://github.com/Rdatatable/data.table/issues/6509) and @aitap for the fix.
119
+
118
120
## NOTES
119
121
120
122
1. Tests run again when some Suggests packages are missing, [#6411](https://github.com/Rdatatable/data.table/issues/6411). Thanks @aadler for the note and @MichaelChirico for the fix.
# Set options for the speed boost in v1.8.0 by avoiding 'default' arg of getOption(,default=)
71
80
# In fread and fwrite we have moved back to using getOption's default argument since it is unlikely fread and fread will be called in a loop many times, plus they
0 commit comments