I tried your proposition Sarah (I was answering to Berend when you posted
your answer).
Well it seems to work!
I just had to add afterwords a line to have my NAs again.
I converted values = 0 by NA (numeric() in the function did the contrary for
the calculation):
mydata[mydata==0] <- NA
At firs
You're moving the goal posts. If you need to deal with internal as
well as terminal NA values in a particular way, it would help to have
told us that up front.
Please give us some sample data that illustrates what you're really
trying to work with, and a full explanation of what you need to
accomp
Thanks for your answer too Berend.
Yes you're right about x[i+1]. You answered juste before me.
Well your idea of declaring all in numeric is great. It avoids my problem.
But actually I also have small missing data gaps in the rest of my data (in
the middle of numeric values).
And one of the aim of
On Thu, May 10, 2012 at 8:02 AM, jeff6868
wrote:
> Thank you for your reply sarah.
> Well actually I don't try to access x[i+1]. The line where you saw it starts
> with #. It was just try I wanted to keep (sorry I should have removed it
> before posting).
Sorry, I should really have more coffee b
Thank you for your reply sarah.
Well actually I don't try to access x[i+1]. The line where you saw it starts
with #. It was just try I wanted to keep (sorry I should have removed it
before posting).
But I ask him to access to the next value if conditions in the loop are not
verified (restart the c
On 10-05-2012, at 12:59, Sarah Goslee wrote:
> Well, if i goes from 2 to length(x) and you try to access x[i+1], of
> course odd things will happen. Why not construct the loop to
> (length(x)-1) instead, so that x[i+1] is defined.
>
The reference to x[i+1] in a commented line so I don't think
Well, if i goes from 2 to length(x) and you try to access x[i+1], of
course odd things will happen. Why not construct the loop to
(length(x)-1) instead, so that x[i+1] is defined.
Sarah
On Thu, May 10, 2012 at 5:14 AM, jeff6868
wrote:
> Hi dear R-users,
>
> I have a question about a function I
7 matches
Mail list logo