Displaying 2 results from an estimated 2 matches for "mrunoff_207101".
2011 Jan 17
2
Summing data frame columns on identical data
Dear all,
I have 9 data frames, and I'm simply trying to sum the values of column 3 (on a row-by-row basis). However, there are a slightly different number of rows in each data frame, so I'm receiving the following error: "Error in Ops.data.frame(mrunoff_207101[3], mrunoff_207102[3]) :
? + only defined for equally-sized data frames".
Here is what I'm attempting to do:
> arunoff_2071 <- cbind(mrunoff_207101[1:2], (mrunoff_207101[3] + mrunoff_207102[3] + mrunoff_207103[3] + mrunoff_207104[3] + mrunoff_207105[3] + mrunoff_207106[3] + mrunof...
2010 Jan 22
1
Looping multiple dimensions
...60, 1:12] NA NA NA NA NA NA NA NA NA NA ...? (the initial NA's are nothing to worry about)
I am looking for a way by which I can extract each of the third dimension of these grids (1:12) in turn, along with the first and second dimensions, to create new objects in the following style:
#2071
mrunoff_207101 <- mrunoff_5221[,,1]
mrunoff_207102 <- mrunoff_5221[,,2]
mrunoff_207103 <- mrunoff_5221[,,3]
mrunoff_207104 <- mrunoff_5221[,,4]
mrunoff_207105 <- mrunoff_5221[,,5]?? ...(etc. - up to [,,12])
#2072
mrunoff_207201 <- mrunoff_5222[,,1]
mrunoff_207202 <- mrunoff_5222[,,2]
mrunoff...