79641730

Date: 2025-05-28 07:45:52
Score: 2.5
Natty:
Report link

This is the reproducible example.

if (!require("data.table")) {
  install.packages("data.table")
  require("data.table")
}

dat <- data.table(a = 1:3)
dat[, b := a + 1]
message("No print above expected, but will occur if you source this script.")

I am suppressing this print by piping it to invisible as follows:

dat[, b := a + 1] |> invisible()

If someone has a better solution, please let us know.

Reasons:
  • RegEx Blacklisted phrase (2.5): please let us know
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Daniel Hoop