R/meshgridn.R

Defines functions meshgridn

Documented in meshgridn

meshgridn = function(L){
  out = list()
  n = sapply(L, length)
  w = 1:length(L)
  for(i in w){
    out[[i]] = rep(rep(L[[i]], rep(prod(n[w<i]), n[i])), prod(n[w>i])) # prod(NULL) == 1, so this works.
  }
  return(out)
}

Try the AtmRay package in your browser

Any scripts or data that you put into this service are public.

AtmRay documentation built on May 2, 2019, 6:52 a.m.