Let R Scripts Kill Themselves
So what is an R script? An R script is simply a text file containing (almost) the same commands that you would enter on the command line of R. (almost) refers to the fact that if you are using sink() to send the output to a file, you will have to enclose some commands in print() to get the same output as on the command line.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.