📜  将参数传递给 group_by - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:54.689000             🧑  作者: Mango

代码示例1
mytable <- function( x, group ) {
  x %>% 
    group_by( .data[[group]] ) %>% 
    summarise( n = n() )
}

group_string <- 'Species'

mytable( iris, group_string )

`summarise()` ungrouping output (override with `.groups` argument)
# A tibble: 3 x 2
  Species        n
        
1 setosa        50
2 versicolor    50
3 virginica     50