Skip to content

[CRAN feedback] Eliminate unwanted console output and side effects in R/report.R #8

@villegar

Description

@villegar

Summary:

  • Address CRAN warnings about writing messages to the console that cannot be easily suppressed. Usage of print(), cat(), and even message() should be conditional, invisible, or returned as an object for user choice. This applies particularly to the following two lines:
print(overview_lst$diag_lst)
message("A report has been written to:\n ", filepath)

(appearing twice: see lines ~252, 267, 602, 617 of R/report.R)

CRAN Cookbook Guidance:

  • Generate information-bearing R objects, let the user extract and print
  • Use message() or warning() only when truly needed, ideally behind a verbose argument
  • Remove or gate all unrequested console output

Code Reference:

Checklist:

  • Remove or make optional (via verbose arg) all print()/message() calls
  • Review usage and add a verbose argument if not present
  • Ensure invisible returns whenever possible
  • Confirm behavior with minimal/no console output by default
  • Add/adjust tests as needed

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions