Closed Bisaloo closed 1 year ago
Alternatively:
x
is 0, we could have "py+" / "py-"x
and y
are 0, "py"Ah, okay — nice catch, thanks!
I'm leaning toward your first idea. So it'd only use y
if x is 0, or vice-versa. Then if both x
and y
are 0 it'd give NA
. (Is there a practical reason to prefer "" over NA
?).
I'll sketch in the fix shortly.
Popped in here - 813622edf1d94b4bc1f600d55388876b86ec22c2
https://github.com/rmaia/pavo/blob/a7f8a4f71547e1c185ba235fa5e256eef17c9e6a/R/categorical.R#L106-L119
This causes issues downstream in
colspace()
/categorical()
becausevapply()
expected a non-NULL character:https://github.com/rmaia/pavo/blob/a7f8a4f71547e1c185ba235fa5e256eef17c9e6a/R/categorical.R#L123
A fix could be to return only "y+" / "y-" based on the value of
y
whenx
is 0. In this scenario, if bothx
andy
are 0, the output ofcolcat()
would be "".