# Providing arguments for `element_rect()`
elem_list_rect(
# The first element_rect will have linetype 1, the second gets 3
linetype = c(1, 3),
# If an argument doesn't exist, it will be silently dropped
nonsense_argument = c("I", "will", "be", "filtered", "out")
)
# Providing arguments for `element_text()`
elem_list_text(
# `NA`s will be skipped
family = c("mono", NA, "sans"),
# Providing a list of more complex arguments. `NULL` will be skipped too.
margin = list(NULL, margin(t = 5))
)
# Providing arguments to other functions
distribute_args(
lineend = c("round", "butt", "square"),
# If you want to pass a vector instead of a scalar, you can use a list
colour = list(c("blue", "red"), "green"),
.fun = element_line
)
Run the code above in your browser using DataLab