Dear friends,

I'm writing a function with three arguments

myfun <- function(theta, X, values)

{
....
....
}

in this function, I'm trying to write consistency checks. In order to compute the statistic of interest I only need theta and values. The idea of having X in there is that, if values is not provided by the user, then values is computed from X.

my problem is I'm trying to write consistency checks. For instance if i say

output <- myfun(beta, val1), how do I ensure that R reads this as passing arguments to "theta" and "values". In other words is it possible to bypass X completely if values is provided. Also how is it possible for R to recognize the second argument as being values and not X. This is important because X is a matrix and values is a vector. Therefore any checks using the dimensions of either one will land in trouble if it does not correctly capture that. 

Thanks in advance
Sincerely

Anup

       
---------------------------------


	[[alternative HTML version deleted]]

