Nothing
First we redefine the output hook:
library(knitr) # the default output hook hook_output = knit_hooks$get('output') knit_hooks$set(output = function(x, options) { if (!is.null(n <- options$out.lines)) { x = knitr:::split_lines(x) if (length(x) > n) { # truncate the output x = c(head(x, n), '....\n') } x = paste(x, collapse = '\n') # paste first n lines together } hook_output(x, options) })
And we do not want the output to be more than 4 lines, so we set this option globally:
opts_chunk$set(out.lines = 4)
Test the new output hook:
1+1 # this is short
The output of this chunk is truncated:
1:100
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.