| brand_pluck | R Documentation |
Safely extracts a nested element from a brand object using the provided key
path. Returns NULL if the element doesn't exist.
brand_pluck(brand, ...)
brand |
A brand object created by |
... |
One or more character strings or symbols representing the path to the nested element. |
The value of the nested element if it exists, NULL otherwise.
Other brand.yml helpers:
brand_color_pluck(),
brand_has(),
with_brand_yml_path()
brand <- as_brand_yml(list(
meta = list(name = "Example Brand"),
color = list(primary = "#FF5733")
))
# Extract the primary color
brand_pluck(brand, "color", "primary") # "#FF5733"
# Try to extract a non-existent element
brand_pluck(brand, "color", "secondary") # NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.