title: How to add separator between elements in a warning message?
body: <p>This question has most likely been answered many times already, but I do not seem to find an answer even after a vigorous search...</p>
  
  <p>I want to create a warning message using a character vector. The elements within the vector should be separated by ", " and should not be repeated. Like this:</p>
  
  <blockquote>
    <p>Warning message: Entries This, that, this too, probably also that should be checked.</p>
  </blockquote>
  
  <p>The function <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/warning.html" rel="nofollow noreferrer"><code>warning</code></a> passes the message to <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/cat.html" rel="nofollow noreferrer"><code>cat</code></a> function, which makes it difficult for me to understand how should I use the <code>cat</code> inside <code>warning</code>:</p>
  
  <pre><code>entries2check &lt;-c("This", "that", "this too", "probably also that")
  
  cat("Entries", entries2check, "should be checked.", sep = ", ")  # works
  # Entries, This, that, this too, probably also that, should be checked.
  
  paste("Entries", entries2check, "should be checked.", collapse = ", ") # repeated
  # [1] "Entries This should be checked., Entries that should be checked., Entries this too should be checked., Entries probably also that should be checked."
  
  # no separator
  warning("Entries ", entries2check, "should be checked.") 
  # Warning message:
  # Entries Thisthatthis tooprobably also thatshould be checked. 
  
  # cat comes before "Warning message:"
  warning(cat("Entries", entries2check, "should be checked.", sep = ", ")) 
  # Entries, This, that, this too, probably also that, should be checked.Warning message:
  
  # correct place, but repeated
  warning(paste("Entries", entries2check, "should be checked.", sep = ", ")) 
  # Warning message:
  # Entries, This, should be checked.Entries, that, should be checked.Entries, this too, should be checked.Entries, probably also that, should be checked. 
  </code></pre>