Displaying 1 result from an estimated 1 matches for "vecfun".
Did you mean:
ecfun
2007 Nov 28
0
Plotting Vector Fields
...y" are expanded into vectors of length n*m,
where
# n = length(x), m = length(y) and this ordering is preserved also in
'values'.
# Matrix of values (list item 'values') and expanded variables (list
items 'x','y') are returned.
expand.outer <- function(x, y, vecfun) {
xy.pairs <- expand.grid(x=x, y=y, KEEP.OUT.ATTRS = FALSE)
x.exp <- xy.pairs$x
y.exp <- xy.pairs$y
list(values=matrix(vecfun(x.exp,y.exp), nrow=2, byrow=TRUE), x=x.exp,
y=y.exp)
}
#! vector field plot function
# grid.points can be defined for both axes at once or separately
plotVectorF...