library(multiApply)


mod <- seq(1, 2 * 3)
obs  <- seq(1, 2 * 3)
dim(mod) <- c(dataset = 2, member = 3)
dim(obs) <- c(dataset = 2, member = 3)

outp <- Apply(data = list(x = obs, y = mod),
              target_dims = list(x = c("member"), y = c("member")),
              fun = function(x,y){cor(x, y)})
apply(mod, 1, function(x){cor(x, c(1,2,3))})
