myouter | R Documentation |
Small utility functions
myouter(x, y, fun) shiftleft(x, k = 1) shiftright(x, k = 1)
x |
a vector. |
y |
a vector. |
k |
a non-negative integer. |
fun |
a function, see ‘Details’. |
myouter(x,y,fun)
computes the outer product of x
and
y
using the function fun
. The result is a matrix with
(i,j)th element equal to fun(x[i],y[j])
. It is not
required for fun to be able to work with vector arguments. The function
does the computations in R using a simple double loop. So, it is a
convenience function, not a speed improving one.
shiftright(x,k)
rotates the vector x
k
positions
to the right.
shiftleft(x,k)
rotates the vector x
k
positions to
the left.
for myouter
, a matrix, as described in ‘Details’
for shiftleft
and shiftright
, a vector
Georgi N. Boshnakov
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.