Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions R/print_linter.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#'
#' The default print method for character vectors is appropriate for interactively inspecting objects,
#' not for logging messages. Thus checked-in usage like `print(paste('Data has', nrow(DF), 'rows.'))`
#' is better served by using [cat()], e.g. `cat(sprintf('Data has %d rows.\n', nrow(DF)))` (noting that
#' using `cat()` entails supplying your own line returns, and that [glue::glue()] might be preferable
#' to [sprintf()] for constructing templated strings). Lastly, note that [message()] differs slightly
#' is better served by using [cat()], e.g. `cat(sprintf('Data has %d rows.\n', nrow(DF)))`. Note that
#' using `cat()` entails supplying your own line returns; [glue::glue()] might be preferable
#' to [sprintf()] for constructing templated strings. Alternatively, [writeLines()] can be used to
#' print character vectors with their own line returns. Lastly, note that [message()] differs slightly
#' from `cat()` in that it prints to `stderr` by default, not `stdout`, but is still a good option
#' to consider for logging purposes.
#'
Expand Down
7 changes: 4 additions & 3 deletions man/print_linter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading