Followup from this question.
It works just fine making a "thin" wrapper, however I'd like to make an actual wrapper and just change the default value of bootstrap_options
in case I want to change some of the other arguments. I've never done this before, and I couldn't really find a basic recipe for this with google or on SO.
I tried just making a simple function:
kable_table <- function(kable_input, bootstrap_options, latex_options,
full_width, position, font_size, row_label_position, ...){
kableExtra::kable_styling(kable_input, bootstrap_options = c("condensed", "bordered", "striped"),
latex_options = "basic", full_width = FALSE, position = "center",
font_size = NULL, row_label_position = "l", ...)
}
And this works for the new bootstrap_options
, but when I change e.g. position
nothing happens. I also tried setting position = NULL
, but that throws an error: Error in if (position == "center") { : argument is of length zero
.
Is there a simple way to just copy a function and change some of the default arguments, or does it require a lot more programming?