[R] Fwd: xtable and sweave: caption placement problem

Brian Diggs diggsb at ohsu.edu
Tue Nov 22 23:32:37 CET 2011


On 11/18/2011 1:22 AM, renger at vannieuwkoop.ch wrote:
> \documentclass[11pt,a4paper]{article}
> \usepackage{Sweave}
> \begin{document}
> <<>>=
> x  =  runif(100,  1,  10)
> y  =  2  +  3  *  x  + rnorm(100)
> @
>
> <<echo=FALSE,results=tex>>=
> library(xtable)
> print(xtable(summary(lm(y~x)),
> align="rcccc",
> caption="Summary  statistics  for  the  regression  model",
> caption.placement="top", label="tab:summary",
> digits=2))
>
> @
>
> \end{document}

caption.placement is an argument to print.xtable, not xtable.

print(xtable(summary(lm(y~x)),
              align="rcccc",
              caption="Summary  statistics  for  the  regression  model",
              label="tab:summary",
              digits=2),
       caption.placement="top")


-- 
Brian S. Diggs, PhD
Senior Research Associate, Department of Surgery
Oregon Health & Science University



More information about the R-help mailing list