如何配置RStudio允许WhiteSmith缩进?

问题描述

有关此缩进模式的详细信息,请参见:http://www.activeclickweb.com/whitesmiths/index.htmlhttps://en.wikipedia.org/wiki/Indentation_style#Whitesmiths_style

使用R,这是使用这种缩进样式的示例基本功能:

# this is "not" recursive at the moment ...
createDir = function (folder)
  {
  ifelse(!dir.exists(folder),dir.create(folder),"Folder exists already")
  }

以下是使用相同样式的函数内的switch语句:

buildX = function(n,method)
  {
  switch(method,"rnorm-0-1" = rnorm(n,1),"rgama-1-0.5" = rgamma(n,1,1/2),rnorm(n,1) # default case of switch
        );
  }

这里是另一个功能,总结一下例子:

buildY = function(resp,n,unif,myQ)
  {
  Y = numeric(n);
  for (i in 1:n)
    {
    Y[i] = mapY(i,myQ,resp);
    }
  Y;
  }

如何配置RStudio使用这种缩进样式?复制粘贴后可以使用吗?

像记事本++一样,可以更容易地突出显示两个大括号的功能的奖励吗?我可以单击打开/关闭支架的右侧/左侧,它会突出显示,甚至创建一条垂直线连接支架...

brace highlighting

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...