Publishing your code online

My most popular languages for data analysis are python and R. I like them for different reasons, and while recently I use predominantly ipython with pandas, I still think ease of visualising things in R is next to none.
One extremely useful thing in both languages is the ability to display your code online:

As of recent both of those can be natively displayed in github as well.

##Rendering jupyter directly via Nbviewer

jupyter can be can be natively displayed in github. Why bother with rendering via Nbviewer? The quick answer is:

How we do it then? Summarising this stackoverflow post:

This will cache notebook on nbviewer server, allowing for quick display but reducing update from source to every 2 hours. This might be a problem, especially if its live project. If you willing to trade the speed away, you can disable flush for almost live update

Still not feeling convinced? Compare two links to Probabilistic Programming and Bayesian Methods for Hackers:
* directly via gihub
* via nbviewer

I hope this convinced you. Let me know, in comments below, if you have any more tips.

##Rendering knitr

I tended to use http://rpubs.com/ to get my R knitr online. It has one major benefit - publishing directly from RStudio which makes things easy. The disadvantage:

Initially, I solved this problem by adding git hub link to my R code. Recently I found a better approach via https://gitcdn.xyz/.

Even more interesting, this article report that R code can be run directly in the jupyter. On my to do list.

If you liked this post, you can Tweet about it or Follow me on Twitter