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

part of issue #446, expand supports list columns but complete does not #537

Merged
merged 7 commits into from
Jan 22, 2019

Conversation

SamanthaToet
Copy link
Contributor

Added a test for type and size of result. complete doesn't work though because it relies on dplyr::left_join which doesn't support list columns currently, @romainfrancois 🦄

formulas <- list(formula1 = Sepal.Length ~ Sepal.Width,
formula2 = Sepal.Length ~ Sepal.Width + Petal.Width,
formula3 = Sepal.Length ~ Sepal.Width + Petal.Width + Petal.Length)
(demo <- tibble::tibble(formulas = formulas, data_sets = data_sets))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the tibble:: prefix here. Also, I'd suggest to create demo only once with a pipe instead of updating it, something like :

demo <- tibble(formulas = formulas, data_sets = data_sets)) %>%
  expand(formulas, data_sets)

@romainfrancois
Copy link
Member

I guess the problem you mention about complete() is related to: tidyverse/dplyr#2355 for which we'll need hashing support from vctrs.

This is planned for the 0.9.* series of dplyr.

R/expand.R Outdated Show resolved Hide resolved
R/spread.R Outdated Show resolved Hide resolved
tests/testthat/test-expand.R Show resolved Hide resolved
@SamanthaToet
Copy link
Contributor Author

Just pushed an update to Romain's comments. Not 100% if I totally fixed the extraneous new line but I used the styler plug in - happy to tweak further.

@hadley
Copy link
Member

hadley commented Jan 22, 2019

Thanks @SamanthaToet! I made a few small changes to focus the docs and test on what was actually changed: the implementation of crossing(). This is particularly important for the test — ideally you want to construct a test that exercises only the new lines of code and nothing else.

@hadley hadley merged commit c7c2ce6 into tidyverse:master Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants