I've spent a bit too long searching the help history and attempting to apply 
some logic to the following:
I have two 3D arrays each with same dim. I wish to run lm on the respective 
columns of each array, preferably without loops.
We often hear chatter that sometimes apply() won't be faster "just use a for 
loop" I'd like to test this one...
I just can't seem to wrap my brain around use of mapply on this task and am 
more surprised that I'm not finding a solution out there already.


a <- array(1:60,dim=5:3)
b <- a*3+10
lm(b[,1,1]~a[,1,1]) 
#and repeat for all rows and columns...

thanks in advance.
Michael

_______________________________________________________
Michael Folkes
Salmon Stock Assessment
Canadian Dept. of Fisheries & Oceans     
Pacific Biological Station

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to