Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What about:</p> <pre><code>&gt; library(pander) &gt; panderOptions('digits', 2) &gt; panderOptions('round', 2) &gt; panderOptions('keep.trailing.zeros', TRUE) &gt; pander(anova.m1) ---------------------------------------------------------- &amp;nbsp; Df Sum Sq Mean Sq F value Pr(&gt;F) --------------- ---- -------- --------- --------- -------- **feed** 5 231129 46226 15 0 **Residuals** 65 195556 3009 ---------------------------------------------------------- Table: Analysis of Variance Table &gt; pander(coef(summary(model1))) ---------------------------------------------------------------- &amp;nbsp; Estimate Std. Error t value Pr(&gt;|t|) ------------------- ---------- ------------ --------- ---------- **(Intercept)** 323.58 15.83 20.44 0.00 **feedhorsebean** -163.38 23.49 -6.96 0.00 **feedlinseed** -104.83 22.39 -4.68 0.00 **feedmeatmeal** -46.67 22.90 -2.04 0.05 **feedsoybean** -77.15 21.58 -3.58 0.00 **feedsunflower** 5.33 22.39 0.24 0.81 ---------------------------------------------------------------- </code></pre> <p>About inline R chunks: also call <code>pander</code> there or apply some hooks to do that automatically.</p> <hr> <p><strong>Update</strong>: there's no need to set the number of digits here as you are after setting the number of decimals, sry:</p> <pre><code>&gt; library(pander) &gt; panderOptions('round', 2) &gt; panderOptions('keep.trailing.zeros', TRUE) &gt; model1 = lm(weight~feed, chickwts) &gt; anova.m1 = anova(model1) &gt; pander(anova.m1) ---------------------------------------------------------- &amp;nbsp; Df Sum Sq Mean Sq F value Pr(&gt;F) --------------- ---- -------- --------- --------- -------- **feed** 5 231129 46226 15.36 0 **Residuals** 65 195556 3009 ---------------------------------------------------------- Table: Analysis of Variance Table &gt; pander(coef(summary(model1))) ---------------------------------------------------------------- &amp;nbsp; Estimate Std. Error t value Pr(&gt;|t|) ------------------- ---------- ------------ --------- ---------- **(Intercept)** 323.58 15.83 20.44 0.00 **feedhorsebean** -163.38 23.49 -6.96 0.00 **feedlinseed** -104.83 22.39 -4.68 0.00 **feedmeatmeal** -46.67 22.90 -2.04 0.05 **feedsoybean** -77.15 21.58 -3.58 0.00 **feedsunflower** 5.33 22.39 0.24 0.81 ---------------------------------------------------------------- </code></pre> <hr> <p><strong>Further update:</strong> and why it worked with set <code>digits</code> in the second table for the first run:</p> <pre><code>&gt; format(c(0.01, 15.36 ), digits = 2) [1] " 0.01" "15.36" &gt; format(15.36, digits = 2) [1] "15" </code></pre> <p>And <code>pandoc.table</code> runs <code>format</code> on a column-basis so that the numbers in a column would have the same number of decimals (even trailing zeros with that option set to <code>TRUE</code>) based on a user-request.</p> <p>Please open an issue at GitHub if this would look like a bug: <a href="https://github.com/Rapporter/pander" rel="noreferrer">https://github.com/Rapporter/pander</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload