有没有办法自动对齐函数参数?

Is there a way to automatically align function arguments?

在 RStudio 中有没有自动对齐函数参数中等号的方法?

类似于以下内容:

objective         = obj,
eta               = params$eta[i],
gamma             = params$gamma[i],
max_depth         = params$max_depth[i],
colsample_bytree  = params$colsample_bytree[i],
colsample_bylevel = params$colsample_bylevel[i],
lambda            = params$lambda[i],
alpha             = params$alpha[i],
subsample         = params$subsample[i])

我发现这更容易阅读。如果它在 RStudio 中不可用,是否有其他具有此功能的编辑器?

我在 AlignAssign RStudio 插件中找到了解决方案:https://github.com/seasmith/AlignAssign

另一种选择是{remedy}, which is also on CRAN

该软件包包括用于对齐等号 = 和赋值 <- 的插件,以及用于处理降价文档的其他插件。