r - Rotate stargazer table in knitr -


i using knitr write .rnw file , stargazer packages build tables regression outputs. part working quite rotate table 90 degrees able in latex using \usepackage{sidewaystable} outside of .rnw

\documentclass{article}  \begin{document}  <<table1, echo=false, message=f, warning=f, results="asis">>= library(stargazer) lm1 <- lm(mpg ~ wt, data = mtcars) lm2 <- lm(mpg ~ hp, data = mtcars) lm3 <- lm(mpg ~ cyl, data = mtcars) lm4 <- lm(mpg ~ disp, data = mtcars)  stargazer(lm1, lm2, lm3, lm4, title = "basic ols models", omit.stat = c("f",    "ser")) @ \end{document} 

you can option float.env = "sidewaystable" in stargazer()

\documentclass{article} \usepackage{rotating, graphicx} \begin{document}  <<table1, echo=false, message=f, warning=f, results="asis">>= library(stargazer) lm1 <- lm(mpg ~ wt, data = mtcars) lm2 <- lm(mpg ~ hp, data = mtcars) lm3 <- lm(mpg ~ cyl, data = mtcars) lm4 <- lm(mpg ~ disp, data = mtcars)  stargazer(lm1, lm2, lm3, lm4,            title = "basic ols models",            omit.stat = c("f",    "ser"),           float.env = "sidewaystable") @ \end{document} 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -