| fgdc_dict | R Documentation |
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).
fgdc_dict(clean = TRUE, nomatch = NULL, wrap = NULL)
clean |
|
nomatch |
|
wrap |
|
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().
FGDC patterns:
fgdc_names,
geo_pattern(),
grid.pattern_geo(),
scale_fill_geopattern()
library(ggplot2)
vals <- c("603", "626", "720", "733")
ggplot(mpg, aes(factor(cyl), fill = vals[factor(cyl)])) +
geom_bar() +
scale_fill_geopattern(name = NULL, labels = fgdc_dict())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.