# NOT RUN {
f3a <- function (x, y, z)
x + 10 * y + 100 * z
f3b <- function (x)
x [,1] + 10 * x [,2] + 100 * x [,3]
x <- seq (0, 10, length.out=4)
fgrid (f3a, x, x, x)
#same as above, but using xlim/ylim style input
cgrid (f3a, c (0, 10), c (0, 10), c (0, 10), n=4)
cgrid (f3b, c (0, 10), c (0, 10), c (0, 10), combine=TRUE, n=4)
#drop argument
#(here, the default drops the first dimension)
cgrid (f3a, 0, c (0, 10), c (0, 10), drop=FALSE, n=4)
cgrid (f3a, 0, c (0, 10), c (0, 10), n=4)
#dropping two dimensions
cgrid (f3a, c (0, 10), 0, 0, n=4)
#different n values
cgrid (f3a, c (0, 10), c (0, 10), c (0, 10), n = c (2, 3, 4) )
# }
Run the code above in your browser using DataLab