title: Make a beautiful report on latex from R
body: <p>I would like to produce a <code>latex</code> report with <code>R</code> code.
  I know that the subject has already been discussed many times, and I get lost between <code>xtable</code>, <code>Hmisc</code>, and packages like <code>stargazer</code> or <code>reporttools</code>.</p>
  
  <p>I have a database containing about thirty variables (quantitative and qualitative), as well as a variable X (on the example TMA yes / no).
  I would like to produce a table containing the summary of each variable, the summary of the variable according to the binary variable X, as well as the appropriate test according to the variable X (Student's test for the quantitative variables and Fisher's for the  qualitative variables).</p>
  
  <p>At the end, I'll get this:</p>
  
  <p><a href="https://i.stack.imgur.com/2vwlF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2vwlF.png" alt="enter image description here"></a></p>
  
  <p>Below a code for the example:</p>
  
  <pre><code>AAA = matrix (data = c (rnorm (10), round (runif (10, min = 1, max = 3), digits = 0), rbinom (10,1,0.5)), nrow = 10, byrow = F)
  AAA = as.data.frame (AAA); AAA $ V2 = as.factor (AAA $ V2) 
  </code></pre>
  
  <p>It's been a week since I struggled to find a solution!</p>
  
  <p>I will be grateful for the slightest help.</p>