How to Easily Embed R code on Your Blog

The easiest, self-explanatory, way is to use Github GIST.

Go to Github GIST. If you want to save your snippets and pastes in Github, you need to open an account (free) in Github GIST.

A simple instruction for embedding Github Gist can be found at http://en.support.wordpress.com/gist/

Note: When you paste the Gist’s url on a line by itself in your post, erase a user name in the url.

For example, instead of pasting https://gist.github.com/jonjhkim/9767971, only paste https://gist.github.com/9767971.

Good luck on your blogging!


 

** Modification on 7/17/2014 **
There is an easier way of embedding source code! Please, use the following tags:

note: please get ride of ! in the tags when you use them.

[!code language=”r”]
# Isn’t this very simple and slick? It is very easy!
# source: http://en.support.wordpress.com/code/posting-source-code/
[!/code]

Output:


# Isn't this very simple and slick? It is very easy!
# source: http://en.support.wordpress.com/code/posting-source-code/ 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s