RStudio代码段不起作用 [英] RStudio snippet not working
问题描述
我正在使用运行"El Capitan"的Macbook pro,RStudio的版本为0.99.902.我正在写一个Rmd文档.我想利用RStudio内置的代码片段并创建自己的代码片段.通过单击首选项=>代码;我可以看到已选中启用代码段".但是,在尝试利用任何代码段时,都不会执行完成操作.如果仅键入r
,我应该获得此代码块,但不会出现
I'm utilizing a Macbook pro running "El Capitan" and RStudio is version 0.99.902. I'm writing a Rmd document. I want to utilize the snippets that RStudio has built in and create my own also. By clicking Preference => Code; I can see that "Enable code snippets" is checked. However, while trying to utilize any snippet the completion is not performed. If I typed just r
I should get this block of code, but nothing hapen
snippet r
```{r ${1:label}, ${2:options}}
${0}
```
我还创建了一个简单的代码段:
I also create a simple snippet:
snippet dthen
%>%
降价代码段似乎都不起作用.我是在做错什么还是必须进行任何设置?
None of the markdown snippet seems to work. Do I'm doing something wrong or any setting has to be done?
推荐答案
键入代码段后,您可以使用Shift + Tab在RStudio中的Markdown中调用代码段,但是当前不会提示您使用Tab键来扩展代码段或只是等待.我以为这是一个错误,但是在此GitHub问题中的讨论 说,这是有意的,只是仍有待记录.
You can invoke code snippets in Markdown in RStudio using Shift+Tab after typing the snippet, but it will not currently prompt you to expand the snippet, either with Tab or by just waiting. I thought this was a bug, but the discussion in this GitHub issue says it's intended, just still-to-be-documented.
这篇关于RStudio代码段不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!