6
我很好奇如何从dplyr
编程功能n
。当dplyr
ENV评估n
,我得到的是这样的:dplyr :: n函数是如何工作的?
function()
{
stop("This function should not be called directly")
}
<environment: namespace:dplyr>
也许这是一个愚蠢的问题,但是,它被定义在哪里?在一些其他功能中调用时它是如何工作的?它隐藏了哪些env?
感谢您的帮助
好问题。 [实际的n()函数](https://github.com/hadley/dplyr/blob/6153e136fa9397e88478fa6270d9d1f02eb5153e/R/manip.r#L337-L339)很容易找到,但它不能解释为什么'n() '在mutate','filter'和'summarise'中工作。它可以在C代码中吗? –
可能是[这](#)(http://stackoverflow.com/questions/39305474/dplyrn-returns-error-this-function-should-not-be-called-直接)帮助 – akrun