Skip to content
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

Add "na.print" as a new argument to "print.data.table" #6087

Merged
merged 9 commits into from
Apr 13, 2024

Conversation

joshhwuu
Copy link
Member

@joshhwuu joshhwuu commented Apr 12, 2024

Closes #3152

  • Confirm we want to honor na.print by exposing it as a new argument to print.data.table, instead of handling it through ... like print.data.frame.
  • Discuss whether we want to handle error throwing/type checking within print.data.table or allow print.default to handle it.
  • Add additional tests

Currently, na.print allows for either NULL or a character string to replace NA values when printing, but print.data.table does not handle this argument. I am suggesting we add the na.print argument to print.data.table and pass it to existing print.default calls, although I think it is possible to handle na.print through ..., although we will have to change some documentation and an extra check.

As for error throwing and type checking, I think the print.default error is clear enough:

invalid 'na.print' specification

However if we want to handle this error through print.data.table (maybe for clarity, translation, etc.), it should be easy enough to add. Currently quote is handled by print.default so I think doing the same for na.print would make sense.

@MichaelChirico
Copy link
Member

Implementation looks good, including yes to including it in the print.data.table signature and to letting print.default to error handling. I think we just need NEWS.

@MichaelChirico MichaelChirico merged commit 7268eff into master Apr 13, 2024
3 checks passed
@MichaelChirico MichaelChirico deleted the addnaprint branch April 13, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

print.data.table should honour na.print
2 participants