pharmaverse / sdtmchecks

Analysis facing checks for SDTM data
https://pharmaverse.github.io/sdtmchecks/
Apache License 2.0
21 stars 8 forks source link

Address writing text to the console #373

Closed sarabodach closed 2 months ago

sarabodach commented 3 months ago
You write information messages to the console that cannot be easily suppressed.

It is more R like to generate objects that can be used to extract the information a user is interested in, and then print() that object. Instead of print()/cat() rather use message()/warning() or if(verbose)cat(..) (or maybe stop()) if you really have to write text to the console. (except for print, summary, interactive functions)
-> R/utils.R
sarabodach commented 3 months ago

image image

sarabodach commented 3 months ago

https://github.com/pharmaverse/sdtmchecks/blob/5ecdd90050b2b13df75bf7458a4a0a1163ab6f54/R/utils.R#L12-L27

https://github.com/pharmaverse/sdtmchecks/blob/5ecdd90050b2b13df75bf7458a4a0a1163ab6f54/R/utils.R#L76-L98

sarabodach commented 3 months ago

https://stackoverflow.com/questions/48499400/suppress-automatic-output-to-console-in-r

sarabodach commented 3 months ago

https://adv-r.hadley.nz/conditions.html