Description Usage Arguments Value See Also Examples
Outer product generalizations, allowing an arbitrary function and an arbitrary number of variables.
Note that the DGrid and CGrid functions provide additional functionality in the 2D case.
1 2 3 4 |
sf |
A suitable function. |
lims |
A two-column matrix of limits. |
seqs |
A list of vectors. |
... |
Alternative ways of specifying lims and seqs, see above. |
drop |
Logical, if true, array dimensions with one value are dropped. |
iterate |
Logical, if true, evaluate the function with one bin/point, at a time. |
cf |
A function used to combine the main arguments. |
n |
Integer vector, of length one, or equal to the length of the main arguments, giving the number of evaluation points, in each dimension. |
An array.
By default (with drop=TRUE), the number of dimensions will equal the number of main arguments, except where any dimension has a single evaluation bin/point.
FGrid-class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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)
xgrid.hdim (f3a, x, x, x)
#same as above, but using xlim/ylim style input
cgrid.hdim (f3a, c (0, 10), c (0, 10), c (0, 10), n=4)
cgrid.hdim (f3b, c (0, 10), c (0, 10), c (0, 10), cf=cbind, n=4)
#drop argument
#(here, the default drops the first dimension)
cgrid.hdim (f3a, 0, c (0, 10), c (0, 10), drop=FALSE, n=4)
cgrid.hdim (f3a, 0, c (0, 10), c (0, 10), n=4)
#dropping two dimensions
cgrid.hdim (f3a, c (0, 10), 0, 0, n=4)
#different n values
cgrid.hdim (f3a, c (0, 10), c (0, 10), c (0, 10), n = c (2, 3, 4) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.