Does this do what you want? Another way of doing matrix addressing:
> dat[cbind(year,region)]
[1] 1 5 9 10 18 3 4 8 16 17 2 6 7 15 19
On 10/23/07, Daniel O'Shea <[EMAIL PROTECTED]> wrote:
> I am trying to distribute the entries of a data frame (dat) to a vector
> (water) based on the
I am trying to distribute the entries of a data frame (dat) to a vector (water)
based on the values of two other vectors (region and year). region is also the
columns and year the rows of the data frame (dat). I can write a bunch of
ifelse statements or I created the for statement below - but
2 matches
Mail list logo