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

granovagg.ds fails even with sensible data #168

Open
briandk opened this issue Mar 20, 2017 · 2 comments
Open

granovagg.ds fails even with sensible data #168

briandk opened this issue Mar 20, 2017 · 2 comments
Labels

Comments

@briandk
Copy link
Owner

briandk commented Mar 20, 2017

library(ggplot2)
library(granovaGG)
library(magrittr)

ggplot2::mpg %>% 
  select(cty, hwy) %>% 
  granovaGG::granovagg.ds(data = .)

produces this error

Error: Length of logical index vector must be 1 or 1, got: 234

@briandk briandk added the ds label Mar 20, 2017
@WilDoane
Copy link
Collaborator

WilDoane commented Mar 20, 2017

This seems to be a tibble issue.Notice that it works for a data.frame:

mtcars %>% select(cyl, mpg) %>% granovagg.ds(data = .)

That suggests that we're subsetting the DF somewhere and assuming we would get a vector back. Tibbles don't behave that way.

ggplot2::mpg[, 1]
ggplot2::mpg['model']

both return tibbles

mtcars[, 1]
mtcars[, 'cyl']

both return vectors.

briandk added a commit that referenced this issue Mar 21, 2017
so they don't choke the `t.test()` function, which seems to get queasy
if you pass it a tibble instead of dataframes. Fixes #168

See documentation for `tibble::is_tibble()`

https://cran.r-project.org/web/packages/tibble/index.html
@briandk
Copy link
Owner Author

briandk commented Mar 21, 2017

@WilDoane you were right on the money: it was failing because of the tibbles. The hard part was figuring out which part was failing. Turns out it was the t.test() function. An unlikely culprit.

But, if I did this right, the fix is just two lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants