Custom function don't read vectors
The number of combinations of size k from a set of size n can be computed with choose(n, k) in R, and if you have multiple k values you can just pass in a vector for k. Therefore your code can be simplified to:

choose(12, 0:12)
#  [1]   1  12  66 220 495 792 924 792 495 220  66  12   1