Thanks Joshua.
You're right, I checked the 'csv' files from FRED and there is no NA.
However, in my computer I get:

> getSymbols("DEXBZUS",src="FRED")
[1] "DEXBZUS"
> sum(is.na(index(DEXBZUS)))
[1] 2

There might be a problem with timezone or something (I am running R in
windows).
The solution you provided works fine. I will, however, have to dig a little
bit further to understand why I got the NAs in the first place, since there
is no NA in the datafile provided by FRED.

thanks
-Paulo


On Sun, Sep 26, 2010 at 12:47 PM, Joshua Ulrich <josh.m.ulrich@gmail.com>wrote:

> On Sun, Sep 26, 2010 at 9:52 AM, Paulo Grahl <pgrahl@gmail.com> wrote:
> > Dear all,
> > I've downloaded the following exchange rate data from FRED
> >
> > library(quantmod)
> > getSymbols("DEXBZUS",src="FRED")
> >
> > And it happens that there are a couple of NA's, not in the data, but in
> the
> > index(DEXBZUS).
>
> Are you doing something after downloading and before checking the
> index for NA values?  I ask because there are no NA index values when
> I download the data.
>
> > getSymbols("DEXBZUS",src="FRED")
> [1] "DEXBZUS"
> > sum(is.na(index(DEXBZUS)))
> [1] 0
>
> > Using na.omit() does not exclude these data points from the time series.
> > I could obviously exclude this points by searching the index() of the
> > series, but I was wondering if xts already has some functionality that
> could
> > handle these cases.
>
> You can do this by using is.na() on the index:
>
> > (x <- xts(1:10,as.Date(c(1:9,NA))))
>           [,1]
> 1970-01-02    1
> 1970-01-03    2
> 1970-01-04    3
> 1970-01-05    4
> 1970-01-06    5
> 1970-01-07    6
> 1970-01-08    7
> 1970-01-09    8
> 1970-01-10    9
> <NA>         10
> > x[!is.na(index(x))]
>           [,1]
> 1970-01-02    1
> 1970-01-03    2
> 1970-01-04    3
> 1970-01-05    4
> 1970-01-06    5
> 1970-01-07    6
> 1970-01-08    7
> 1970-01-09    8
> 1970-01-10    9
>
> HTH,
> --
> Joshua Ulrich
> FOSS Trading: www.fosstrading.com
>
>
>
> > Thanks
> > Paulo
> >
> >
> > --
> > Paulo Gustavo Grahl, CFA
> > ------------------------------------------
> > pgrahl@gmail.com
> > pgrahl@fgvmail.br
> > +55(21) 8809-9254
> > skype:paulo.grahl
> > www.linkedin.com/in/pgrahl
> > ------------------------------------------
> >
> >        [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-SIG-Finance@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> > -- Subscriber-posting only. If you want to post, subscribe first.
> > -- Also note that this is not the r-help list where general R questions
> should go.
> >
>



-- 
Paulo Gustavo Grahl, CFA
------------------------------------------
pgrahl@gmail.com
pgrahl@fgvmail.br
+55(21) 8809-9254
skype:paulo.grahl
www.linkedin.com/in/pgrahl
------------------------------------------

	[[alternative HTML version deleted]]

