Skip to content
Back to formatted view

Raw Message

Message-ID: <488A3764.3090201@witthoft.com>
Date: 2008-07-25T20:28:20Z
From: Carl Witthoft
Subject: How to pass function argument of same name to internal call?

I ran across this problem when playing with ccf().
Its function call is

 >function (x, y, lag.max = NULL, type = c("correlation", "covariance"),
     plot = TRUE, na.action = na.fail, ...)

Internally,  ccf() calls plot(), which digs up plot.acf() whose default 
style is type='h' .

I wanted to pass the argument type='l' to the plotting routine, but of 
course I can't put two arguments named "type" into the ccf() call.
I made do with the work-around of writing "myccf," with the argument for 
the acf() call changed to "cortype," but that's ugly.

Is there a way to "escape" an argument so it gets ignored by the main 
function and only gets read by the internally-called function?

thanks for any ideas.
Carl