title: How to view a list like table style in r
body: <p>I am facing an issue as how to presenting data in a list as table (data frame) format, in the list each element as a character vector, and these vectors may have different length, the example list as below:</p>
  
  <pre><code>sample_list &lt;- list("Matched x" = c("Ella", "Mila"), "Unmatched x" = c("Isla"), "Matched y" = c(), "Unmatched y" = c("Emma", "Olivia"))
  sample_list
  </code></pre>
  
  <p>Normally, if you use <code>str(sample_list)</code>, it will print as below:  </p>
  
  <pre><code>&gt; str(sample_list)
  List of 4
   $ Matched x  : chr [1:2] "Ella" "Mila"
   $ Unmatched x: chr "Isla"
   $ Matched y  : NULL
   $ Unmatched y: chr [1:2] "Emma" "Olivia"
  </code></pre>
  
  <p>Is there a way to show the result on <code>R markdown</code> (<code>.Rmd</code> file) generated file (e.g <code>.html</code> / <code>.pdf</code>) as below (<strong>no need strictly same but like table style</strong>) ?<br>
  <a href="https://i.stack.imgur.com/8pPyl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8pPyl.png" alt="enter image description here"></a></p>