[R] Trying to pass arrays as arguments to a function

Claudia Beleites cbeleites at units.it
Mon Oct 20 15:23:54 CEST 2008

> I'd like to avoid looping through an array in order to change values in
> the array as it takes too long.
> I red from an earlier post it can be done by "do.call" but never got it
> to work. The Idea is to change the value of "y" according to values in
> "x". Wherever "x" holds the value 3, the corresponding value in "y"
> should be set to 1.
y [x == 3] <- 1

Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 (0 40) 5 58-34 47
email: cbeleites at units.it

More information about the R-help mailing list