How to Change the Default Arguments for a Function

I have this function called xlkabular:

xlkabular <- function(...) knitr::kable(escape = FALSE, booktabs = TRUE, xltabular = TRUE,


I set the default linesep to \\addlinespace, but if the user wants to change it like this:

xlkabular(df, linesep = "\\hline", caption = "Table")


It gives an error because the linesep argument is given twice. How do I make it so that it sets the default to \\adddlinespace but the user can change it if they want?

Does this work for you? I don't have the packages to check it.

xlkabular <- function(DF, Mylinesep = "\\addlinespace", ...) knitr::kable(DF, escape = FALSE, booktabs = TRUE, xltabular = TRUE,
linesep = Mylinesep, ...) |>


or this

xlkabular <- function(DF, linesep = "\\addlinespace", ...) knitr::kable(DF, escape = FALSE, booktabs = TRUE, xltabular = TRUE,
linesep = linesep, ...) |>