[Rd] How to create a function calling two functions with unknown number of parameters?

2008-04-05 Thread ZT2008


... can be used to represent unknown number of parameters passed into a
function. 

For example, I write a function g. g calls another function f1. 

For example f1 could be different random number generation function. 

when f1=rnorm(), it has 3 parameters n, mean and standard deviation.

when f1=rexp(), it has 2 parameters n and rate. 

g can be defined as

g <- function(f1, ...) {
f1(...)
}

My problem is what about g calls two functions with unknown number of
parameters.

In this case one ... doesn't help. 

If I define g as follows:

g <- function(f1, f2, ...) {
f1(...)+f2(...)
}

It seems ... is only passed to f1, it can't be passed to f2. 

Can anybody help me? Thanks!

-- 
View this message in context: 
http://www.nabble.com/How-to-create-a-function-calling-two-functions-with-unknown-number-of-parameters--tp16501233p16501233.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Computational singularity of a positive definite matrix

2008-06-07 Thread ZT2008

I'm trying to use function "solve" to find the inverse of a matrix, which is
positive definite in theory. But for some situations, I get error message
because of computational singularity. I'm wondering if I can set the
tolerance for detecting linear independence to an infinitely small value to
avoid this problem. Is there any serious consequence by doing this? Are
there other solutions to this problem? Thanks.
-- 
View this message in context: 
http://www.nabble.com/Computational-singularity-of-a-positive-definite-matrix-tp17702809p17702809.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel