Skip to content

Commit 2066c38

Browse files
Mention writeLines() in ?print_linter (#2997)
Co-authored-by: Hugo Gruson <[email protected]>
1 parent a6cdb2a commit 2066c38

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

R/print_linter.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
#'
33
#' The default print method for character vectors is appropriate for interactively inspecting objects,
44
#' not for logging messages. Thus checked-in usage like `print(paste('Data has', nrow(DF), 'rows.'))`
5-
#' is better served by using [cat()], e.g. `cat(sprintf('Data has %d rows.\n', nrow(DF)))` (noting that
6-
#' using `cat()` entails supplying your own line returns, and that [glue::glue()] might be preferable
7-
#' to [sprintf()] for constructing templated strings). Lastly, note that [message()] differs slightly
5+
#' is better served by using [cat()], e.g. `cat(sprintf('Data has %d rows.\n', nrow(DF)))`. Note that
6+
#' using `cat()` entails supplying your own line returns; [glue::glue()] might be preferable
7+
#' to [sprintf()] for constructing templated strings. Alternatively, [writeLines()] can be used to
8+
#' print character vectors with their own line returns. Lastly, note that [message()] differs slightly
89
#' from `cat()` in that it prints to `stderr` by default, not `stdout`, but is still a good option
910
#' to consider for logging purposes.
1011
#'

man/print_linter.Rd

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)