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

mean_table can't call a variable "x" #36

Open
mbcann01 opened this issue Jan 18, 2018 · 1 comment
Open

mean_table can't call a variable "x" #36

mbcann01 opened this issue Jan 18, 2018 · 1 comment
Labels
bug Something isn't working high priority Start here

Comments

@mbcann01
Copy link
Member

mbcann01 commented Jan 18, 2018

This doesn't work:

library(tidyverse)
library(bfuncs)

df <- tibble(
  g = c(rep("a", 5000), rep("b", 5000)),
  x = runif(10000, 0, 100)
)

df %>% group_by(g) %>% bfuncs::mean_table(x)

Error in summarise_impl(.data, dots) : 
  Evaluation error: `expr` must quote a symbol, scalar, or call. 

But this does work:

df <- tibble(
  g = c(rep("a", 5000), rep("b", 5000)),
  a = runif(10000, 0, 100)
)

df %>% group_by(g) %>% bfuncs::mean_table(a)
@mbcann01 mbcann01 added bug Something isn't working high priority Start here labels Jan 18, 2018
@mbcann01 mbcann01 self-assigned this Jan 18, 2018
@mbcann01 mbcann01 removed their assignment Sep 30, 2018
@mbcann01
Copy link
Member Author

Also, can't call variable "n"

This doesn't work:

aps_its %>% 
  group_by(study_week, group) %>% 
  summarise(n = n()) %>% 
  group_by(group) %>% 
  mean_table(n)

But, this does:

aps_its %>% 
  group_by(study_week, group) %>% 
  summarise(n = n()) %>% 
  group_by(group) %>% 
  mutate(count = n) %>% 
  mean_table(count)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority Start here
Projects
None yet
Development

No branches or pull requests

1 participant