Re: [R] Getting Rid of NaN in ts Object

2016-05-28 Thread Martin Maechler
> Perfect! > Exactly what I was looking for. > Thanks > Lorenzo > On Fri, May 27, 2016 at 01:50:03PM +0200, Christian Brandstätter wrote: >> Hi Lorenzo, >> >> Try: >> >> tt[is.nan(tt)] <- NA >> tt <- na.omit(tt) >> or simply na.omit(tt) as it omits both NA and NaN (and *does* keep the 'ts'

Re: [R] Getting Rid of NaN in ts Object

2016-05-27 Thread PIKAL Petr
Hm > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon > Sent: Friday, May 27, 2016 12:46 PM > To: Lorenzo Isella > Cc: r-help@r-project.org > Subject: Re: [R] Getting Rid of NaN in ts Object > > Hi Lorenzo, > M

Re: [R] Getting Rid of NaN in ts Object

2016-05-27 Thread Lorenzo Isella
Perfect! Exactly what I was looking for. Thanks Lorenzo On Fri, May 27, 2016 at 01:50:03PM +0200, Christian Brandstätter wrote: Hi Lorenzo, Try: tt[is.nan(tt)] <- NA tt <- na.omit(tt) Best, Christian Am 27.05.2016 um 13:38 schrieb Lorenzo Isella: On Fri, May 27, 2016 at 08:46:20PM +1000,

Re: [R] Getting Rid of NaN in ts Object

2016-05-27 Thread Christian Brandstätter
Hi Lorenzo, Try: tt[is.nan(tt)] <- NA tt <- na.omit(tt) Best, Christian Am 27.05.2016 um 13:38 schrieb Lorenzo Isella: On Fri, May 27, 2016 at 08:46:20PM +1000, Jim Lemon wrote: Hi Lorenzo, Maybe: tt<-tt[!is.nan(tt)] Jim Not really. tt<-structure(c(NaN, NaN, NaN, NaN, NaN, NaN, NaN,

Re: [R] Getting Rid of NaN in ts Object

2016-05-27 Thread Lorenzo Isella
On Fri, May 27, 2016 at 08:46:20PM +1000, Jim Lemon wrote: Hi Lorenzo, Maybe: tt<-tt[!is.nan(tt)] Jim Not really. tt<-structure(c(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, + NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 1133.09, 1155.77, 1179.12, + 1182.85, 1133.43, 1103.36, 1081.19, 10

Re: [R] Getting Rid of NaN in ts Object

2016-05-27 Thread Jim Lemon
Hi Lorenzo, Maybe: tt<-tt[!is.nan(tt)] Jim On Fri, May 27, 2016 at 8:14 PM, Lorenzo Isella wrote: > Dear All, > I am sure the answer is a one liner, but I am banging my head against > the wall and googling here and there has not helped much. > Consider the following time series > > tt<-structu

[R] Getting Rid of NaN in ts Object

2016-05-27 Thread Lorenzo Isella
Dear All, I am sure the answer is a one liner, but I am banging my head against the wall and googling here and there has not helped much. Consider the following time series tt<-structure(c(NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 1133.09, 1155.77,