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
But there's a new bug if you mix NULL with other variables:
df<-dplyr::arrange(mtcars, NULL, am)
#> Error: `direction` should have length 1 or length equal to the number of columns of `x` when `x` is a data frame.
A correct solution should handle both of these cases:
df<-dplyr::arrange(mtcars, NULL, am)
#> Error: `direction` should have length 1 or length equal to the number of columns of `x` when `x` is a data frame.x<-NULLdf<-dplyr::arrange(mtcars, x, am)
#> Error: `direction` should have length 1 or length equal to the number of columns of `x` when `x` is a data frame.
When programming with
dplyr
, it can be handy to passNULL
as a value.For instance when using
group_by()
, I can passNULL
when I want to use my custom function but I don't want to group on any variable.However, while
group_by()
allow this syntax,arrange()
throws an unexpected error:Created on 2022-02-24 by the reprex package (v2.0.1)
This might be related to #6093.
The text was updated successfully, but these errors were encountered: