Sweave中是否有与\ Sexpr {}等效的R Markdown? [英] Is there an R Markdown equivalent to \Sexpr{} in Sweave?

查看:74
本文介绍了Sweave中是否有与\ Sexpr {}等效的R Markdown?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在knitr中使用R Markdown是否等效于Sweave中的\Sexpr{}?

Using R Markdown in knitr is there an equivalent to \Sexpr{} in Sweave?

推荐答案

是.您可以使用

`r your_expression_here`

类似

2+2 is: `r 2+2`

应产生:

2+2 is: 4

我最初发现很难弄清楚您可以在knitr中使用的每种不同样式(html,markdown,sweave等)的不同语法是什么,然后求助于Yihui的最小示例(效果很好),但是如果您可以阅读正则表达式,则可以查看

I initially found it a little difficult trying to figure out what the different syntax was for each of the different styles you could use in knitr (html, markdown, sweave, ...) and resorted to looking at Yihui's minimal examples (which do a good job) but if you can read regular expressions you can view the default pattern definitions. You even have the option of defining your own syntax if you want.

这篇关于Sweave中是否有与\ Sexpr {}等效的R Markdown?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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