Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should spread have digits argument? #208

hadley opened this issue Jun 13, 2016 · 1 comment

Should spread have digits argument? #208

hadley opened this issue Jun 13, 2016 · 1 comment


Copy link

@hadley hadley commented Jun 13, 2016

To avoid mutate here:


prob <- seq(0, 1, length = 10)
mtcars %>%
  group_by(cyl) %>%
  summarise(q = list(quantile(mpg, prob)), p = list(prob)) %>%
  unnest() %>%
  mutate(p = format(p, digits = 2)) %>%
  spread(p, q, sep = "_")

This comment has been minimized.

Copy link
Member Author

@hadley hadley commented Mar 3, 2019

Now handled via pivot spec: if you want greater control over column names, you can generate the col_names yourself

@hadley hadley closed this Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.