[R] Execute a function

2012-07-20 Thread carla moreira
Hi, I would like to evaluate a function, with 3 arguments, for instance, myfunc-function(a,b,c) { sqrt(a)-exp(b)+4*c } How to execute myfunc(x,y,z), for all x, all y and all z, where x,y,z are vectors? Thank you very much in advance -- View

Re: [R] Execute a function

2012-07-20 Thread Carla Moreira
) myfunc(1,2,1) myfunc(1,2,2) myfunc(2,1,1) myfunc(2,1,2) myfunc(2,2,1) myfunc(2,2,2) ? On 20.07.2012, at 13:05, carla moreira wrote: Hi, I would like to evaluate a function, with 3 arguments, for instance, myfunc-function(a,b,c) { sqrt(a)-exp(b)+4*c

Re: [R] Execute a function

2012-07-20 Thread carla moreira
Yes, that's this. Thank you very much. 2012/7/20 Peter Ehlers [via R] ml-node+s789695n463721...@n4.nabble.com On 2012-07-20 04:05, carla moreira wrote: Hi, I would like to evaluate a function, with 3 arguments, for instance, myfunc-function(a,b,c) { sqrt(a)-exp(b)+4*c

Re: [R] How to calculate the product of every two elements in two lists?

2011-06-14 Thread carla moreira
this # Shows what is going on at each step: lapply(seq(ncol(o1)), function(s) o1[, s] * o2) # Concatenate all product columns together into a matrix: do.call(cbind, lapply(seq(ncol(o1)), function(s) o1[, s] * o2)) HTH, Dennis On Mon, Jun 13, 2011 at 6:23 AM, carla moreira [hidden email]http

Re: [R] How to calculate the product of every two elements in two lists?

2011-06-14 Thread carla moreira
Hi, I always find memory problems when usuing mapply, lapply for samples sizes 500 or more. Carla -- View this message in context: http://r.789695.n4.nabble.com/How-to-calculate-the-product-of-every-two-elements-in-two-lists-tp3593832p3596088.html Sent from the R help mailing list archive at

[R] How to calculate the product of every two elements in two lists?

2011-06-13 Thread carla moreira
u-c(0.1,0.2,0.3) v-c(0.2,0.3,0.5) outer1-outer(u,u,=) outer2-outer(v,v,=) m-nrow(outer1) j-nrow(outer2) zz-lapply(1:m, function(m) as.numeric(outer1[m,])) tt-lapply(1:m, function(m) as.numeric(outer2[m,])) zz[[1]]*tt[[3]], e.g., is possible, but I want every products between two lists. Is

Re: [R] How to calculate the product of every two elements in two lists?

2011-06-13 Thread carla moreira
Thank you very much. I want each element of zz by each element of tt (i.e., every possible 2-way combination). -- View this message in context: http://r.789695.n4.nabble.com/How-to-calculate-the-product-of-every-two-elements-in-two-lists-tp3593832p3593941.html Sent from the R help mailing

[R] Add more functions or dataset in my package

2010-11-02 Thread Carla Moreira
Hello, I have constructed an R package, however, now I need to add a dataset in the package. How can I do it? Thank you very much in advance. -- Carla Moreira [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https