# Passing arguments to other function (equivalent of R's "...")

**URL:** <https://discourse.julialang.org/t/passing-arguments-to-other-function-equivalent-of-rs/14175>\
**Category:** New to Julia\
**Created:** [August 28, 2018, 7:13am UTC](https://discourse.julialang.org/t/passing-arguments-to-other-function-equivalent-of-rs/14175 "2018-08-28T07:13:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DominiqueMakowski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dominiquemakowski/32/51410_2.png) [@DominiqueMakowski](https://discourse.julialang.org/u/DominiqueMakowski)\
**Post date:** [August 28, 2018, 7:13am UTC](https://discourse.julialang.org/t/passing-arguments-to-other-function-equivalent-of-rs/14175/1 "2018-08-28T07:13:47Z")

</div>

Is there any way of passing undefined arguments to a function within a function?

I’ve tried with `kwargs...` but it seems that I’m doing something wrong…

```julia
function f(x::Number; a=1, b=2, c=3, d=4)
  return(x+a+b+c+d)
end

function f(x::Vector; kwargs...)
  out = f.(x, kwargs...)
end

f(1) # works
f([1, 2]) # works
f([1, 2], c=6) # Doesn't work

```

---

<div class="post-metadata">

**Author:** ![Evizero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evizero/32/10118_2.png) [@Evizero](https://discourse.julialang.org/u/Evizero)\
**Post date:** [August 28, 2018, 8:01am UTC](https://discourse.julialang.org/t/passing-arguments-to-other-function-equivalent-of-rs/14175/2 "2018-08-28T08:01:05Z")

</div>

Note the `;`

```julia
julia> function f(x::Number; a=1, b=2, c=3, d=4)
         return(x+a+b+c+d)
       end
f (generic function with 1 method)

julia> function f(x::Vector; kwargs...)
         out = f.(x; kwargs...)
       end
f (generic function with 2 methods)

julia> f([1, 2], c=6)
2-element Array{Int64,1}:
 14
 15

```

---

<div class="post-metadata">

**Author:** ![DominiqueMakowski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dominiquemakowski/32/51410_2.png) [@DominiqueMakowski](https://discourse.julialang.org/u/DominiqueMakowski)\
**Post date:** [August 28, 2018, 8:05am UTC](https://discourse.julialang.org/t/passing-arguments-to-other-function-equivalent-of-rs/14175/3 "2018-08-28T08:05:42Z")

</div>

That was subtle, thanks 😁
