A labeling function that takes
a vector x of pattern numbers and returns a character vector of
length(x) giving the corresponding pattern names. The function is
designed to be used with the labels argument of ggplot2 scales, such as
scale_fill_geopattern() and ggpattern::scale_pattern_type_identity().
Arguments
clean
logical. Should the pattern names be cleaned? If TRUE
(default), the names will be cleaned to remove strings such as "(2nd
option)". If FALSE, the names will be verbatim from the FGDC standard.
Note that pattern names may not be unique when this is set to TRUE.
nomatch
character. A string to label values that do not match any
name in the dictionary. When NULL (default), the values are kept as-is.
wrap
integer. If not NULL, the pattern names will be wrapped to
the specified width (in characters) by insertting line breaks between words
using strwrap() (words will not be broken). This can be useful for making
long names fit better in legends. If NULL (default), no wrapping is done.