r - Change variable name in dplyr::count using standard evaluation -


how change name of grouping variable in dplyr::count_ when it's used in standard evaluation way

for example if in final tbl don't want var name "species" "type" :

iris %>%    group_by("species") %>%    count_("species")  source: local data frame [3 x 2]       species  n 1     setosa 50 2 versicolor 50 3  virginica 50 

also wonder how dplyr::count_ works , expression supposed ? have explanation ?

> iris %>% group_by("species") %>% count_("x = species") source: local data frame [3 x 2]  x = species  n 1      setosa 50 2  versicolor 50 3   virginica 50 

thanks !

well, used setnames before posting in wrong way. seems solution :

count_(iris, setnames("species", "type")) 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -