将R markdown文件发布为博客文章 [英] Publishing R markdown files as blog post

查看:56
本文介绍了将R markdown文件发布为博客文章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想发布这样的基本博客文章:使用我的R降价文件(示例博客文章).

但是我想将其发布在Wordpress中(而不是wordpress.com).

  • 最有前途的解决方案似乎是 Yihui的功能.我试过了但这有很多错误,请停止尝试.我正在使用Windows,似乎Yihui的knit2wp函数在Linux上稳定运行.(我从他页面中的评论之一中扣除了这一点)
  • 以下帖子也没有帮助:.
  • >
  • 我试图将我的降价发布在GitHub上,例如(),如下所示:在 Jerom Anglim的博客文章(非常有用的博客文章BTW).无法弄清楚如何将GitHub文件嵌入到Wordpress中.
  • 我考虑将整个博客作为一个很好的例子,但是更改整个博客结构似乎很艰巨.

没有一个解决方案对我有用.我放弃.复制和粘贴代码以及格式化效率很低.我无法正确对齐我的r输出.
还有其他我没发现或可能解决(或缓解)我的问题的方法吗?
预先感谢您的任何回复.

解决方案

您是否尝试过"Pretty R语法荧光笔"?( http://www.inside-r.org/pretty-r/tool)?除非您能进行其他操作,否则这可能是一个不错的临时解决方法.

此代码:

  y<-1:10情节(y) 

变成这样:

 `

 

嵌入到您的html中时,其显示如下:

y <-1:10

绘图(y)

(Example blog post) using my R markdown files.

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

  • The most promising solution seems to be Yihui's function. I tried that but got many errors and stop trying. I'm using Windows and it seems like Yihui's knit2wp function works stable at Linux. (I deduct this from one of the comments in his page)
  • Following posts did not help as well: this, this.
  • I tried to publish my markdown in GitHub like (this) as mentioned in Jerom Anglim's blog post (very informative blog post BTW). Can't figure out how to embed the GitHub file into Wordpress.
  • I considered moving my whole blog to Jekyll as one very good example, but it seemed very daunting to change the whole blog structure.

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

解决方案

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

This code:

y <- 1:10
plot(y)

gets turned 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 imbedded in your html, displays like this:

y <- 1:10

plot(y)

Created by Pretty R at inside-R.org

这篇关于将R markdown文件发布为博客文章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆