No problem -- best of luck with it: the zoo package is one of the best
documentation-wise and I'd advise you to look at the available
vignettes when you have time.
Vignettes are extended documentation included in some packages that
give a more systematic presentation than can be given in the help
Wow, thank you for all your answers.
You were completely right michael. Well, it's my fault. I didn't understood
your 2nd reply, when you were talking about arguments for larger gaps. I
thought it was for deleting big gaps too. I apologize.
It was too easy in fact. I also didn't noticed the argume
>
> Michael,
>
> First of all, thank you very much for your answer.
> I've read your 2 answers, but I'm not really sure that they corresponds
to
> my problem of NAs.
You shall read answers more carefully
x<-rnorm(20)
x[3:4]<-NA
x[12:19]<-NA
x
[1] -0.30754528 0.07597988 NA N
Like I said in my followup, please pass the maxgap argument: i.e.,
na.approx(x, maxgap = 4)
x <- zoo(1:20, Sys.Date() + 1:20)
x[2:4] <- NA # Short run of NA's
x[10:16] <- NA # Long run of NA's
na.approx(x) # All filled in
na.approx(x, maxgap = 4) # Only the short one filled in
Michael
On Tue,
On Tue, Apr 3, 2012 at 4:52 AM, jeff6868
wrote:
> Hi everybody,
>
> I'm a new R french user. Sorry if my english is not perfect. Hope you'll
> understand my problem ;)
>
> I have to work on temperature data (35000 lines in one file) containing some
> missing data (N/A). Sometimes I have only 2 or
Forgot to mention that the offsets were into the 'gaps' (result of the
rle) and 'offsets' which is the index into the original data there the
gap starts.
> gaps
Run Length Encoding
lengths: int [1:5] 2 2 4 14 2
values : logi [1:5] FALSE TRUE FALSE TRUE FALSE
> offsets
[1] 1 3 5 9 23
>
On
> x <- read.table(text="09/01/2008 12:00 1.93
+ 09/01/2008 12:15 3.93
+ 09/01/2008 12:30 NA
+ 09/01/2008 12:45 NA
+ 09/01/2008 13:00 4.93
+ 09/01/2008 13:15 5.93
+ 09/01/2008 16:152.93
+ 09/01/2008 16:302.93
+ 09/01/2008 16:45
Michael,
First of all, thank you very much for your answer.
I've read your 2 answers, but I'm not really sure that they corresponds to
my problem of NAs.
I'll try to detail you a bit more.
This problem concerns the second part of my program. In the first part, I've
already created a timeseries ob
Sorry -- left out a major detail: most of these functions have maxgap
arguments which allow you to leave larger gaps of NAs as NAs.
Best,
Michael
On Tue, Apr 3, 2012 at 9:24 AM, R. Michael Weylandt
wrote:
> It seems like you could benefit from using a zoo [time series] object
> to hold your data
It seems like you could benefit from using a zoo [time series] object
to hold your data -- then you have a variety of NA filling functions
which work for arbitrarily long gaps. E.g.,
library(zoo)
x <- zoo(1:100, Sys.Date() + 1:100)
x[2:60] <- NA
# Most of these look the same because the data is s
Hi everybody,
I'm a new R french user. Sorry if my english is not perfect. Hope you'll
understand my problem ;)
I have to work on temperature data (35000 lines in one file) containing some
missing data (N/A). Sometimes I have only 2 or 3 N/A following each other,
but I have also sometimes 100 or
11 matches
Mail list logo