Skip to content

Should spread have digits argument? #208

@hadley

Description

@hadley

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementpivoting ♻️pivot rectangular data to different "shapes"

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions