Message-ID: <CAP+bYWC8rRGFb_NaHMkeawJa0Y6BcBhNiMW4cviBt8tMfvZJsA@mail.gmail.com>
Date: 2012-02-13T23:04:00Z
From: Hasan Diwan
Subject: only 0s may be mixed with negative subscripts
In-Reply-To: <CAK4FJ1DAwqfVBU6evA8JXfBGp2Udepw7f0p0V6zSa1vXJrpqBA@mail.gmail.com>
On 13 February 2012 14:46, ilai <keren at math.montana.edu> wrote:
> The function you posted runs without error (on these 6 lines), but
> does not return anything that looks remotely like a sum, or cumsum of
> anything. Can you clarify what you are trying to do? I assume by "sum
> of every other row" you don't mean summing Time, X and Y for rows
> 1,3,5,..., ?
I'm trying to get a piecewise sum of every n rows in a given column in
this data set.
> For the sum of sens2[c(1,3,5,...),] for every column (assuming no NA's
> in the data) you could
I do format checking well before getting to this stage in the analysis.
>
> ?(1:nrow(sens2) %% 2) %*% as.matrix(sens2)
That does not do what I want... Again, what it should return is a list
of the sum of the current and preceding row.
--
Sent from my mobile device
Envoyait de mon portable