在Rstudio的自动完成中,如何在使用dplyr :: mutate时显示函数的第一个参数? [英] In Rstudio's auto complete, how to show the first argument of a function when using dplyr::mutate?

查看:532
本文介绍了在Rstudio的自动完成中,如何在使用dplyr :: mutate时显示函数的第一个参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用管道%>%可以看到rstudio了解管道并且不会在自动完成中显示第一个参数。但是这是导致一个麻烦, dplyr :: mutate 。参见下面的屏幕截图

It's nice to see that rstudio understands pipes and doesn't display the first argument in autocomplete when using a pipe %>%. But this is causing a trouble with dplyr::mutate. See for example the screen shot below

示例代码:

iris %>% 
    mutate(gsub("a","A",Species))

我想看到 gsub gsub(

推荐答案

当您在gsub之后键入开头的括号时,我会看到整个方法签名弹出如下:

When you type in the opening parentheses after "gsub", I see the entire method signature pop up like this:

但是,当我按照您建议的方式尝试标签自动填充时,这是我看到的:

However, when I try the tab autocomplete in the way you suggested, this is what I see:

你的截图截断了我认为这是图片中至关重要的部分:如果你看到参数列表的底部,你会看到Sepal。长度。我不知道如何,但我认为管道操作员的实施可能是负责任的。它只是在2014年才推出的,所以有一些徘徊的bug是不可信的。如果要获得最准确的参数表示,我建议您查看弹出窗口(您在第一个屏幕截图中看到的内容),而不是自动填充列表。

Your screenshot cut off what I think is a crucial part of the picture here: if you look at the bottom of the argument list, you'll see "Sepal.Length" mentioned. I'm not sure how, but I think the implementation of the piping operator might be responsible. It was only introduced in 2014, so it's not implausible that there are some lingering bugs. If you want to get the most accurate representation of the arguments, I would suggest looking at the pop up (what you see in my first screenshot) instead of the autocomplete list.

这篇关于在Rstudio的自动完成中,如何在使用dplyr :: mutate时显示函数的第一个参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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