teunbrand / ggh4x

ggplot extension: options for tailored facets, multiple colourscales and miscellaneous

Home Page:https://teunbrand.github.io/ggh4x/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how elem_list_rect function accept named vector or list to be used as parameters?

junjunlab opened this issue · comments

commented

Hi, I am comming again. I want to used a named vector or list to the elem_list_rect() function, but I found the doesn't work:

column_strip_setting_list = c(color = "red",fill = "white")
# or
column_strip_setting_list = list(color = "red",fill = "white")

background_x = elem_list_rect(column_strip_setting_list)


The function accepts key = value arguments, not a list of arguments.
To programmatically call the function with arguments in a list, you can do do.call(elem_list_rect, column_strip_setting_list).
This isn't really any different to how most functions in R work with ellipsis (...), so I don't think this is a bug.