Improve behaviour when labeller()
does not find a match in lookup table
#4599
Labels
facets 💎
help wanted ❤️
we'd love your help!
messages
requests for improvements to error, warning, or feedback messages
Currently,
ggplot2::labeller()
silently labels the facets with "NA" if the user supplies unnamed character vectors.If there is a typo in the name (or if there just isn't a new label defined in the vector), the same thing happens: "NA" is given as a title.
I am not sure what would be most appropriate, but I would have expected to get something like this:
The function allows using lookup tables that include superfluous data, which is probably good for flexibility, but I think that naming a facet with "NA" should throw a warning, or at least a message, when the is not enough data.
Or should the default behaviour change to using the original label if no match is found, allowing the use of partial lookup tables? I can see people wanting to only cherry pick a couple of labels to replace.
Using:
The text was updated successfully, but these errors were encountered: