r - Overlapping tables from grid.arrange in gridExtra -


i'm trying build automated report have 3 charts right underneath each other without margin space between each other.

i've mocked problem following rmd script

--- output: pdf_document ---  ```{r setup, include=false} library(gridextra) ```  ```{r, echo=false} car_tbl <- tablegrob(mtcars[1:10,]) grid.arrange(car_tbl, car_tbl, car_tbl) ``` 

you can see how tables overlap each other. there seems there few issues comprising problem.

  1. how use options of tablegrob , grid.arrange keep tables overlapping.
  2. how make sure nothing cut off? in other words, how set graphic take whole page if need too?
  3. how can re-actively shrink text of plot fit on 1 page?
  4. how can set size of page whatever size want? there options set knitr document print pdf page of size want? perhaps poster size if need to?

there different angles approach question. here's working example 3 tables fitting in 1 chunk placed on pdf of size a2.

--- output: pdf_document geometry: paper=a2paper ---  ```{r setup, include=false} library(gridextra) ```  ```{r, echo=false, fig.height=10} car_tbl <- tablegrob(mtcars[1:10,]) grid.arrange(car_tbl, car_tbl, car_tbl) ``` 

to address questions specifically,

1. how use options of tablegrob , grid.arrange keep tables overlapping. 

their overlap had more default fig.height set knitr.

2. how make sure nothing cut off? in other words, how set graphic take whole page if need too? 

make sure figure height , page big enough table.

3. how can re-actively shrink text of plot fit on 1 page? 

it's not trivial, guess done. doubt it's idea though (for typographical reasons): typically font size should set, , if table doesn't fit, should split several pages (there's example in link provided).

3. how can set size of page whatever size want? there options set knitr document print pdf page of size want? perhaps poster size if need to? 

it's latex question, in context of rmd documents means pass these layout options latex via rmarkdown , pandoc, typically options geometry package.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -