search for: threedimensional

Displaying 3 results from an estimated 3 matches for "threedimensional".

2003 Jul 11
3
short puzzles
Dear R users, can someone help with these short puzzles? 1) Is there a function like outer() that evaluates a three-argument function on a threedimensional grid - or else how to define such a function, say, outer.3()? E.g., calculate (x/y)^z on (x,y,z) element of {1,2,3}x{3,4}x{4,5} and return the results in a 3-dimensional array. I would naively use outer() on two of the arguments within a for() loop for the third argument and somehow glue the array...
2000 Apr 13
1
how convert an array to a matrix?
Dear R-list, is it possible to convert a threedimensional array to a matrix? The array has the form , , -4 -4 -3 -2 -1 0 1 2 3 4 -80 1588 NA 1171 NA 1121 NA 852 NA 1580 0 1497 NA 1311 NA 762 NA 1185 NA 1466 80 1960 NA 1257 NA 941 NA 1435 NA 1636 [...] I need a matrix like -80 -4 -4 1588 -80 -3 -4 NA -80 -2 -4 1171 etc. I?ve...
2011 Mar 30
4
a for loop to lapply
Dear all, I am trying to learn lapply. I would like, as a test case, to try the lapply alternative for the Shadowlist<-array(data=NA,dim=c(dimx,dimy,dimmaps)) for (i in c(1:dimx)){ Shadowlist[,,i]<-i } ---so I wrote the following--- returni <-function(i,ShadowMatrix) {ShadowMatrix<-i} lapply(seq(1:dimx),Shadowlist[,,seq(1:dimx)],returni) So far I do not get same results