you're title=..
statement is almsot there.
you want to use instead:
title = paste(match.call()[-(1:2)], collapse=" ")
# the collapse argument is optional, it's not clear
# how you would like to handle multiple arguments
Notice the two main differences from what you had:
- using
[-(1:2)]
instead of[1]
. The element frommatch.call()
is the function name, which you do not want. Alternatively, you can usematch.call()[3]
if you want just the second argument. - In this situation, there is no need for
do.call(.)
.paste
works just fine.