title: What are the differences between concatenating strings with cat() and paste()?
body: <p>What are the differences between concatenating strings with <code>cat</code> and <code>paste</code>? </p>
  
  <p>In particular, I have the following questions.</p>
  
  <ol>
  <li><p>Why does R <strong>not</strong> use the double quote (<code>"</code>) when it prints the results of calling <code>cat</code> (but it uses quotes when using <code>paste</code>)?</p>
  
  <pre><code>&gt; cat("test")
  test
  &gt; paste("test")
  [1] "test"
  </code></pre></li>
  <li><p>Why do the functions <code>length</code> and <code>mode</code>, which are functions available for almost all objects in R, <strong>not</strong> "work" on <code>cat</code>?</p>
  
  <pre><code>&gt; length(cat("test"))
  test[1] 0
  &gt; mode(cat("test"))
  test[1] "NULL"
  </code></pre></li>
  <li><p>Why do C-style escape sequences work with <code>cat</code>, but <strong>not</strong> with <code>paste</code>?</p>
  
  <pre><code>&gt; cat("1)Line1\n 2)Line2\n 3)Line3")
  1)Line1
   2)Line2
   3)Line3
  &gt; paste("1)Line1\n 2)Line2\n 3)Line3")
  [1] "1)Line1\n 2)Line2\n 3)Line3"
  </code></pre></li>
  <li><p>Why doesn't R's recycling rule work with <code>cat</code>?</p>
  
  <pre><code>&gt; cat("Grade", c(2, 3, 4, 5))
  Grade 2 3 4 5
  &gt; paste("Grade", c(2, 3, 4, 5))
  [1] "Grade 2" "Grade 3" "Grade 4" "Grade 5"
  </code></pre></li>
  </ol>