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

data_frame() doesn't recycle like mutate() does -- bug or feature? #2360

Closed
rpruim opened this issue Jan 16, 2017 · 1 comment
Closed

data_frame() doesn't recycle like mutate() does -- bug or feature? #2360

rpruim opened this issue Jan 16, 2017 · 1 comment

Comments

@rpruim
Copy link

@rpruim rpruim commented Jan 16, 2017

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
@krlmlr

This comment has been minimized.

Copy link
Member

@krlmlr krlmlr commented Jan 16, 2017

Thanks for reporting!

@hadley hadley closed this Jan 31, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jun 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.