Note that there are some explanatory texts on larger screens.

plurals
  1. POLaTeX table through xtable
    text
    copied!<p>I wonder how to get LATEX table using xtable function from the following <em>R</em> code.</p> <pre><code>Block &lt;- gl(8, 4) A &lt;- factor(c(0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, 0,1,0,1,0,1,0,1,0,1,0,1)) B &lt;- factor(c(0,0,1,1,0,0,1,1,0,1,0,1,1,0,1,0,0,0,1,1, 0,0,1,1,0,0,1,1,0,0,1,1)) C &lt;- factor(c(0,1,1,0,1,0,0,1,0,0,1,1,0,0,1,1,0,1,0,1, 1,0,1,0,0,0,1,1,1,1,0,0)) Yield &lt;- c(101, 373, 398, 291, 312, 106, 265, 450, 106, 306, 324, 449, 272, 89, 407, 338, 87, 324, 279, 471, 323, 128, 423, 334, 131, 103, 445, 437, 324, 361, 302, 272) aovdat &lt;- data.frame(Block, A, B, C, Yield) summary(aov(Yield~Block+A*B+Error(A*Block), data=aovdat)) Error: A Df Sum Sq Mean Sq A 1 3465.3 3465.3 Error: Block Df Sum Sq Mean Sq Block 7 4499 642.71 Error: A:Block Df Sum Sq Mean Sq F value Pr(&gt;F) B 1 41616 41616 3.5354 0.1091 Residuals 6 70628 11771 Error: Within Df Sum Sq Mean Sq F value Pr(&gt;F) B 1 119568 119568 7.3751 0.01673 * A:B 1 28 28 0.0017 0.96734 Residuals 14 226975 16213 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 </code></pre> <p>Using the following code</p> <pre><code>xtable(summary(aov(Yield~Block+A*B+Error(A*Block), data=aovdat))) </code></pre> <p>producing the following error</p> <pre><code>Error in rbind(deparse.level, ...) : numbers of columns of arguments do not match </code></pre> <p>Is it possible to get a LaTeX table like this?</p> <pre><code>SOV Df Sum Sq Mean Sq F value Pr(&gt;F) A 1 3465.3 3465.3 Block 7 4499 642.71 B 1 41616 41616 3.5354 0.1091 Residuals 6 70628 11771 B 1 119568 119568 7.3751 0.01673 * A:B 1 28 28 0.0017 0.96734 Residuals 14 226975 16213 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 </code></pre>
 

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