Skip to content

Instantly share code, notes, and snippets.

@rmflight
Created June 15, 2012 18:44
Show Gist options
  • Save rmflight/2938114 to your computer and use it in GitHub Desktop.
Save rmflight/2938114 to your computer and use it in GitHub Desktop.
knitr setup for Rmd files

This code block goes at the top of every Rmd file that I create for eventual conversion by knitr

# sets output for inline results nicely
knit_hooks$set(inline = identity) 

# kills knitr if there is an error, therefore we don't waste time generating error messages
knit_hooks$set(error = function(x, options) stop(x)) 

# these are extremely useful options for working in R
options(save.defaults=list(compress="xz"), stringsAsFactors=FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment