Oh yeah, oops but it still isn't adding up...
[1] 1973
On Wed, Jun 24, 2009 at 10:27 AM, Joshua Ulrich<josh.m.ulrich at gmail.com
wrote:
That won't provide the result you're looking for. It is testing if
the result of is.na() is a character string, so it will always be
FALSE because is.na() returns logical values (either TRUE or FALSE,
no
quotes). Try this instead:
nrow(is.na(VI) == FALSE)
or
sum(is.na(VI))
The results of head()/tail() in your previous email show that WMP has
at least one NA value.
Best,
Josh
--
http://www.fosstrading.com
On Wed, Jun 24, 2009 at 10:22 AM, Kenneth
Spriggs<ksspriggs at gmail.com> wrote:
nrow(is.na(VI) == 'FALSE')
nrow(is.na(WMP) == 'FALSE')
On Wed, Jun 24, 2009 at 10:02 AM, Joshua Ulrich <josh.m.ulrich at gmail.com
Hi Kenneth,
to.period() removes NAs before aggregating. So I would guess WMP
has
4 rows with NA, and those same values in VI are zero.
HTH,
Josh
--
http://www.fosstrading.com
On Wed, Jun 24, 2009 at 9:52 AM, Kenneth Spriggs<ksspriggs at gmail.com
Both VI and WMP are derived from the same xts object - they have
the
same rows. When I use to.minutes() on VI it yields 618 rows but
for
WMP it yields 614 rows.
(Same thing if I use to.period() but that's not surprising.)
You can
see both the start times and end times are the same...
LastPrice
2009-06-22 21:41:54.869 0
LastPrice
2009-06-23 18:59:59.735 25689
head(WMP, 1); tail(WMP, 1)
BidPrice
2009-06-22 21:41:54.869 NA
BidPrice
2009-06-23 18:59:59.735 115.4746
VI_minute2 <- to.minutes(VI,2)
WMP_minute2 <- to.minutes(WMP, 2)
nrow(VI_minute2); nrow(WMP_minute2)
VI_minute2p <- to.period(VI, period = "minutes", k=2)
WMP_minute2p <- to.period(WMP, period = "minutes", k=2)
nrow(VI_minute2p); nrow(WMP_minute2p)