title: R: Tables with returns [Stargazer example]
body: <p>I have a dataset containing different stock returns that I want to show in a stargazer table. The problem is that the last row in the dataframe contains NA's in 2 of the 3 columns. Also when I output with stargazer it shows mean, max, min, etc. I only want the actual return value that I have in my dataframe.</p>
  
  <p>Example code:</p>
  
  <pre><code>#Creating dataframe
  X &lt;- data.frame("Group" = c("Value", "Growth", "HML"), "Excess of riskfree" = c(0.1, 0.2,NA), 
                  "Excess of Market" = c(0.2,0.4,NA), "Nominal" = c(0.5, 0.6, 0.01))
  
  #Displaying my dataframe
  &gt; X
  
     Group Excess.of.riskfree Excess.of.Market Nominal
  1  Value                0.1              0.2    0.50
  2 Growth                0.2              0.4    0.60
  3    HML                 NA               NA    0.01
  
  #Setting up stargazer table
  
  stargazer(X, title="Table 1: Returns", align=T, digits=4, out="Table1_Ret.txt", no.space=T, flip=T)
  
  #This gives the following table
  
  
  
  Table 1: Returns
  =====================================================
  Statistic Excess.of.riskfree Excess.of.Market Nominal
  -----------------------------------------------------
  N                 2                 2            3   
  Mean            0.1500            0.3000      0.3700 
  St. Dev.        0.0707            0.1414      0.3158 
  Min             0.1000            0.2000      0.0100 
  Pctl(25)        0.1250            0.2500      0.2550 
  Pctl(75)        0.1750            0.3500      0.5500 
  Max             0.2000            0.4000      0.6000 
  -----------------------------------------------------
  </code></pre>
  
  <p>Basically, I want the stargazer table to be somewhat equal to the display of my dataframe in R (Group as Rows and variables as column names). And just display the return values, not the statistical approach which seems to be the default layout. </p>
  
  <p>Doesn't necessarily have to be a table from the stargazer package, if there are other (simpler) solution I would be glad to receive that as well!</p>