Generates a labeling function/dictionary based on the built-in fgdc_names dataset that can be used to retrieve the names of patterns based on their pattern numbers/codes as defined in the FGDC Digital Cartographic Standard for Geologic Map Symbolization by the U.S. Geological Survey and the Geologic Data Subcommittee (GDS) of the Federal Geographic Data Committee (FGDC). Like fgdc_names, only patterns with names are included (i.e., patterns 601-733).
Arguments
- clean
logical. Should the pattern names be cleaned? IfTRUE(default), the names will be cleaned to remove strings such as "(2nd option)". IfFALSE, the names will be verbatim from the FGDC standard. Note that pattern names may not be unique when this is set toTRUE.- nomatch
character. A string to label values that do not match any name in the dictionary. WhenNULL(default), the values are kept as-is.- wrap
integer. If notNULL, the pattern names will be wrapped to the specified width (in characters) by insertting line breaks between words usingstrwrap()(words will not be broken). This can be useful for making long names fit better in legends. IfNULL(default), no wrapping is done.
Value
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().
See also
FGDC patterns:
fgdc_names,
geo_pattern(),
grid.pattern_geo(),
scale_fill_geopattern()

