You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expand_grid() is meant to replace the purrr::cross() family. However, these functions vary fastest, and expand_grid() only varies slowest (in the sense of vec_expand_grid()).
Although varying slowest might be more useful overall, there is no other designated replacement for the cross() functions. Their current docs say that cross() and expand_grid() can be used equivalently, but as that very example shows, the order of combinations is different. This was first noted in tidyverse/purrr#768.
It would be truly equivalent if expand_grid() had a .vary parameter passed to vec_expand_grid() that could be set to "fastest" in this case. The default should still be "slowest". Alternatively, vec_expand_grid() itself could fulfill this role, which should then be advertised in the cross() docs.
Some use cases do require varying fastest (although I don't know how common this is). For example, the vectors creating the background patterns in these plots were made using cross2(), and the patterns wouldn't emerge when varying slowest.
The text was updated successfully, but these errors were encountered:
expand_grid()
is meant to replace thepurrr::cross()
family. However, these functions vary fastest, andexpand_grid()
only varies slowest (in the sense ofvec_expand_grid()
).Although varying slowest might be more useful overall, there is no other designated replacement for the
cross()
functions. Their current docs say thatcross()
andexpand_grid()
can be used equivalently, but as that very example shows, the order of combinations is different. This was first noted in tidyverse/purrr#768.It would be truly equivalent if
expand_grid()
had a.vary
parameter passed tovec_expand_grid()
that could be set to"fastest"
in this case. The default should still be"slowest"
. Alternatively,vec_expand_grid()
itself could fulfill this role, which should then be advertised in thecross()
docs.Some use cases do require varying fastest (although I don't know how common this is). For example, the vectors creating the background patterns in these plots were made using
cross2()
, and the patterns wouldn't emerge when varying slowest.The text was updated successfully, but these errors were encountered: