Hi all, I have a newbie question: If I have a function with the following documentation: ca.jo(x, type = c("eigen", "trace"), ecdet = c("none", "const", "trend"), K = 2, spec=c("longrun", "transitory"), season = NULL, dumvar = NULL) Let's take "type" as an example... if I omit this parameter when calling the function, what's going to be the default value for this parameter? Amazingly the documentation didn't say which one is the default... Thank you! [[alternative HTML version deleted]]
The first one -- this is implemented by match.arg(). Michael On Mon, Apr 2, 2012 at 5:30 PM, Michael <comtech.usa at gmail.com> wrote:> Hi all, > > I have a newbie question: > > If I have a function with the following documentation: > > > ca.jo(x, type = c("eigen", "trace"), ecdet = c("none", "const", "trend"), K = 2, > spec=c("longrun", "transitory"), season = NULL, dumvar = NULL) > > Let's take "type" as an example... if I omit this parameter when > calling the function, > > > > what's going to be the default value for this parameter? > > > > Amazingly the documentation didn't say which one is the default... > > Thank you! > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Yes, it's a bit subtle. Argument matching is usually done through match.arg(), so see ?match.arg for an explanation.. (the first chosen). -- Bert On Mon, Apr 2, 2012 at 2:30 PM, Michael <comtech.usa at gmail.com> wrote:> Hi all, > > I have a newbie question: > > If I have a function with the following documentation: > > > ca.jo(x, type = c("eigen", "trace"), ecdet = c("none", "const", "trend"), K = 2, > spec=c("longrun", "transitory"), season = NULL, dumvar = NULL) > > Let's take "type" as an example... if I omit this parameter when > calling the function, > > > > what's going to be the default value for this parameter? > > > > Amazingly the documentation didn't say which one is the default... > > Thank you! > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm