Re: [R] R functions with array arguments

2009-09-17 Thread Maurizio Paolillo
__ R-help@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.

Re: [R] R functions with array arguments

2009-09-17 Thread baptiste auguie
Try this, sapply(Mabslim , my_gamma, alpha=-1, xstar = -21, xmax = -27) or wrap it with ?Vectorize, vmy_gamma = Vectorize(my_gamma, vectorize.args = "xlim") vmy_gamma(alpha=-1, xstar = -21, xlim= Mabslim, xmax = -27) HTH, baptiste 2009/9/17 Maurizio Paolillo : > Dear R users, > I'm trying t

[R] R functions with array arguments

2009-09-17 Thread Maurizio Paolillo
Dear R users, I'm trying to implement a self-defined function with multiple arguments, one of which is an array, but I find that the result is a single value instead of an array. This is the example I'm working on: # define integration limit vector > Mabslim <- c(-17.95, -16.65, -17.27, -17.