Skip to content
Prev 96477 / 398500 Next

Function with an array (extracted from a matrix) as argument

I wrote a function f whose argument is an array

If I set

x <- c(5,1,2)

and I run f(x) everything works fine.

On the other hand, If I extract the same array
from a matrix by:

x <- my.matrix[1,1:3]

such that the first three elements of the
first row of my.matrix are exactly 5  1  2,
something seems to work differently.

Any idea about that?

Thanks in advance,
Alessandro