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

Closed
hadley opened this issue Jun 13, 2016 · 1 comment
Closed

Should spread have digits argument? #208

hadley opened this issue Jun 13, 2016 · 1 comment

Comments

@hadley
Copy link
Member

@hadley hadley commented Jun 13, 2016

To avoid mutate here:

library(tidyr)
library(dplyr)

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 = "_")
@hadley

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
Projects
None yet
1 participant
You can’t perform that action at this time.