Sebastian Zeki Sebastian Zeki - 1 year ago 80
R Question

Options for knit2html

I am getting fairly confused about setting options for the html output with knitr

I have an R script and I would like to create a report from it
To do this I am using spin from knitr as follows:



My R script is very long but all I want to see is the FinalTable so I have done as follows:


However the final html contains everything, messages, errors etc etc from the whole script

Where can I adjust the options so i just see the table? Options to do this don't seem to be available in
or in spin so I'm not sure out to adjust the options to get what I want

Answer Source

If you can, post a link to your script so the issue can be better diagnosed.

You most likely need to set the knitr chunk options to suppress warnings and messages. You can suppress errors, but your code will keep running if you do so. Include this near the top of your script.

#+ setup, include=FALSE
knitr::opts_chunk$set(warning = FALSE, message = FALSE)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download