[R] Apply a function on an array with the parameter as an array

Bert Gunter gunter.berton at gene.com
Tue Jan 26 20:54:18 CET 2010



-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of anna
Sent: Tuesday, January 26, 2010 11:48 AM
To: r-help at r-project.org
Subject: [R] Apply a function on an array with the parameter as an array


Hello R buddies, I want to apply a function on an array but for each element
of the array I want to use a different parameter, So here is how I tried to
enter the function:
apply(as.matrix(X),2, function, parameter1 = arrayOfParameter)
I put X as a matrix because it was initially an element of a list. It
returns me an array with the same length as X but with values that I don't
even understand...Can someone please help me?


-- Probably not. You haven't read and followed the posting guide and
provided a small reproducible example so we know exactly what you tried to
do.

Bert Gunter
Genentech Nonclinical Statistics



More information about the R-help mailing list