Publish markdown R files as a blog post

I want to post a basic blog post: (Example blog post) using my R. markup files

But I want to publish it in Wordpress (and not Wordpress.com).

  • The most promising solution is the Yihui function . I tried this, but got a lot of errors and stopped trying. I use Windows and it seems that the Yihui knit2wp function works stably on Linux. (I subtract this from one of the comments on my page).
  • The following posts also did not help: this , this .
  • I tried posting my markdown on github ( this ) as mentioned in Jerome Anglim's blog post (a very informative BTW blog post). I can't figure out how to insert a github file into Wordpess.
  • I decided to move my entire blog to Jekyll as one very good example , but it seemed very difficult to change the whole structure of the blog.

None of the solutions worked for me. I give up. Copying and pasting code and formatting are very inefficient. I cannot properly align my output r.
Is there any other way that I don't stumble and possibly solve (or alleviate) my problem?
Thanks in advance for any reply.

+8
github r markdown rstudio wordpress
source share
1 answer

Have you tried Pretty R's syntax ( http://www.inside-r.org/pretty-r/tool )? It can be a nice temporary fix until you get something else.

This code:

y <- 1:10 plot(y) 

turns into this:

 `<div style="overflow:auto;"><div class="geshifilter"><pre class="r geshifilter-R" style="font-family:monospace;">y <span style="">&lt;-</span> <span style="color: #cc66cc;">1</span><span style="">:</span><span style="color: #cc66cc;">10</span> <a href="http://inside-r.org/r-doc/graphics/plot"><span style="color: #003399; font-weight: bold;">plot</span></a><span style="color: #009900;">&#40;</span>y<span style="color: #009900;">&#41;</span></pre></div></div><p><a href="http://www.inside-r.org/pretty-r" title="Created by Pretty R at inside-R.org">Created by Pretty R at inside-R.org</a></p>` 

which when attached to your html is displayed as follows:

y <- 1:10

plot (y)

Created by Pretty R at inside-R.org

0
source share

All Articles