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
In base-R, character values are not "finite" (i.e. is.finite("a") is FALSE). Therefore, if remove_missings() with finite = TRUE encounters a character column, it throws away everything. Thus, the first of the following two lines raises a warning and returns an empty data.frame, while the second line preserves the input data.frame:
For me, this led to the following problem that I found extremely difficult to debug: I had a custom stat with required_aes = c("x", "colour"). If the colour-aesthetic was mapped to a factor column, everything worked as expected - non-NA-values of factor variables are finite. If the colour-aesthetic was mapped to a character column, the layer was dropped.
I too had this problem for the "label" aesthetic. I ended up with a workaround, wrapping the column in a vctrs-class with alternative is.finite() methods, but it isn't pretty. There was mention of an is_finite() generic to handle special cases here: #4189 (comment).
In base-R, character values are not "finite" (i.e.
is.finite("a")
isFALSE
). Therefore, ifremove_missings()
withfinite = TRUE
encounters a character column, it throws away everything. Thus, the first of the following two lines raises a warning and returns an empty data.frame, while the second line preserves the input data.frame:For me, this led to the following problem that I found extremely difficult to debug: I had a custom
stat
withrequired_aes = c("x", "colour")
. If the colour-aesthetic was mapped to a factor column, everything worked as expected - non-NA-values of factor variables are finite. If the colour-aesthetic was mapped to a character column, the layer was dropped.Minimal example:
The text was updated successfully, but these errors were encountered: