Skip to content

Improve recycling for reused atomic values in tibble() #213

@krlmlr

Description

@krlmlr

Original issue tidyverse/dplyr#2360 by @rpruim.

The following result for data_frame() is unexpected (to me) given the result of mutate() below it.

data_frame(a = 1:3, b = 1, c = b/sum(b))
## # A tibble: 3 × 3
##       a     b     c
##   <int> <dbl> <dbl>
## 1     1     1     1
## 2     2     1     1
## 3     3     1     1
data_frame(a = 1:3) %>% mutate(b = 1, c = b/sum(b))
## # A tibble: 3 × 3
##       a     b         c
##   <int> <dbl>     <dbl>
## 1     1     1 0.3333333
## 2     2     1 0.3333333
## 3     3     1 0.3333333

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorcategory:interface

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions