[R] How to disable verbose grob results in pdf when using knitr with gridExtra?

vod vos vodvos at zoho.com
Sun Feb 12 08:27:15 CET 2017

Sorry for no reproducible example.

using warnings=FALSE chunk options in knitr does not help. I found it is not the knitr's business.  I used 

resultpdf<- grid.arrange(facetpoint1,pright1,pright2,pright3,pright4,pright5,pright6,pright7, ncol=2, layout_matrix=cbind(c(1,1,1,1,1,1,1),c(2,3,4,5,6,7,8)), widths=c(2,1)) 



in my chunk.

I removed object resultpdf, just used code below to produce figure

grid.arrange(facetpoint1,pright1,pright2,pright3,pright4,pright5,pright6,pright7, ncol=2, layout_matrix=cbind(c(1,1,1,1,1,1,1),c(2,3,4,5,6,7,8)), widths=c(2,1)) 

then no verbose appeared.

The problem is using print() with ggplot2.

---- On 星期六, 11 二月 2017 07:45:54 -0800 Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote ----

On Sat, 11 Feb 2017, vod vos wrote: 


> Hi every one, 


> I am using Knitr, 


Keep in mind that this list is about R first and foremost. There is a 

mailing list for Knitr, and also the maintainer of the knitr package 

recommends asking questions on stackoverflow.com. 


> R and Latex to produce pdf file. When using gridExtra to set up a 

> gtable layout to place multiple grobs on a page, 


> grid.arrange(facetpoint1,pright1,pright2,pright3,pright4,pright5,pright6,pright7, ncol=2, layout_matrix=cbind(c(1,1,1,1,1,1,1),c(2,3,4,5,6,7,8)), widths=c(2,1)) 


This is not a reproducible example. No matter where you ask this question 

you need to supply a complete short script that exhibits the problem. That 

also means including enough data IN THE SCRIPT to allow the script to 

run. There are multiple guides online that describe how to do this in 



> the verbose of the infomation shows before the one figure in the pdf file: 


> ## TableGrob (7 x 2) "arrange": 8 grobs ## z cells name grob ## 1 1 (1-7,1-1) arrange gtable[layout] ## 2 2 (1-1,2-2) arrange gtable[layout] ## 3 3 (2-2,2-2) arrange gtable[layout] ## 4 4 (3-3,2-2) arrange gtable[layout] ## 5 5 (4-4,2-2) arrange gtable[layout] ## 6 6 (5-5,2-2) arrange gtable[layout] ## 7 7 (6-6,2-2) arrange gtable[layout] ## 8 8 (7-7,2-2) arrange gtable[layout] 


None of this appears when I created my own reproducible R example: 


#### begin code 




facetpoint1 <- pright1 <- pright2 <- pright3 <- pright4 <- pright5 <- 

pright6 <- pright7 <- textGrob("X") 

grid.arrange( facetpoint1, pright1, pright2, pright3, pright4, pright5 

 , pright6, pright7 

 , ncol=2 

 , layout_matrix = cbind( c( 1, 1, 1, 1, 1, 1, 1 ) 

 , c( 2, 3, 4, 5, 6, 7, 8 ) ) 

 , widths = c( 2, 1 ) 


#### end code 


If the above example produces output for you in R or in a knitted PDF then 

something is different about your setup than mine. 


> When I ?grid.arrange, no ways were found to disable the verbose in the pdf file. Any ideas? 


Does this happen at the R console? If it does, please post a reproducible 

example, and the invocation and output of sessionInfo() (mine is below). 

If it doesn't, there could be some interaction with knitr going on, and 

using the echo=FALSE or warnings=FALSE chunk options could help, or you 

may need more specialized help than we can offer here (e.g. via one of 

the knitr support areas mentioned above). 


> Thanks. 


>     [[alternative HTML version deleted]] 


When you don't set your email to plain text, the automatic conversion of 

HTML to text is very likely to cause us to see something quite different 

than you were looking at. It is in your best interest to figure out how to 

set your email program to send plain text. Please read the Posting Guide: 


> ______________________________________________ 

> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 

> https://stat.ethz.ch/mailman/listinfo/r-help 

> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 

> and provide commented, minimal, self-contained, reproducible code. 



Jeff Newmiller The ..... ..... Go Live... 

DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... 

 Live: OO#.. Dead: OO#.. Playing 

Research Engineer (Solar/Batteries O.O#. #.O#. with 

/Software/Embedded Controllers) .OO#. .OO#. rocks...1k 


> sessionInfo() 

R version 3.3.2 (2016-10-31) 

Platform: x86_64-pc-linux-gnu (64-bit) 

Running under: Ubuntu 14.04.5 LTS 









attached base packages: 

[1] grid stats graphics grDevices utils datasets methods 


other attached packages: 

[1] gridExtra_2.2.1 

loaded via a namespace (and not attached): 

 [1] backports_1.0.4 magrittr_1.5 rprojroot_1.1 htmltools_0.3.5 


 [6] gtable_0.2.0 yaml_2.1.14 Rcpp_0.12.8 stringi_1.1.2 


[11] knitr_1.15.1 stringr_1.1.0 digest_0.6.11 evaluate_0.10 

	[[alternative HTML version deleted]]

More information about the R-help mailing list