title: Print rest of list in iteration with indeterminate length in same paste function
body: <p>I am new to R and need help with this iterable. Here is my code:</p>
  <pre><code>vec1 &lt;- c(&quot;John&quot;, &quot;Cat&quot;)
  vec2 &lt;- c(&quot;Matthew&quot;, &quot;Dino&quot;, &quot;Dog&quot;, &quot;Bird&quot;)
  vec3 &lt;- c(&quot;James&quot;, &quot;Snail&quot;, &quot;Worm&quot;, &quot;Frog&quot;, &quot;Dragon&quot;)
  list1&lt;- list(vec1, vec2, vec3)
  
  printer &lt;- function(list1) {
    for (item in list1) {
      print(paste(paste(item[1], &quot;'s pets are&quot;, sep = ''), paste(item[2:length(item)], sep = ' ')))
    }
  }
  
  printer(list1)
  </code></pre>
  <p>The result</p>
  <pre><code>[1] &quot;John's pets are Cat&quot;
  [1] &quot;Matthew's pets are Dino&quot; &quot;Matthew's pets are Dog&quot;  &quot;Matthew's pets are Bird&quot;
  [1] &quot;James's pets are Snail&quot;  &quot;James's pets are Worm&quot;   &quot;James's pets are Frog&quot;   &quot;James's pets are Dragon&quot;
  </code></pre>
  <p>I'm trying to have the pet names all print in the same line, but they keep printing separate.</p>