[R] update on my weird problem

From: Leeds, Mark (IED) <Mark.Leeds_at_morganstanley.com>
Date: Sat 28 Oct 2006 - 01:55:46 GMT

as jim pointed out ( i think we were figuring this out simultaneously. thanks a lot jim ), it looks it does have something to do with the fact that it's a zoo object because below i consider two cases.  

in the first case, fxdatab is a zoo object and i get the length of temp to be 1.
in the second case, fxdatac is a matrix and the results in temp are correct.  

gabor : i really hate to bother you because i already do WAY too much so if
unclass as jim figured out and then as.zooing afterwards with the original index is what you suggest, that's fine with me.  


fxdatab<-structure(c(0,4,0,4,0,4,0,4),.Dim=c(4,2),.Dimnames = list(c("1","2","3","4"),c("bid","ask")), index=structure(c(1144049400,1144049400,1144049400,1144050402),class=c(" POSIXt","POSIXct"),tzone = ""),class="zoo")  


fxdatab<-fxdatab[(( fxdatab[,"bid"] > 0.0 ) & ( fxdatab[,"ask"] > 0.0

temp<-( fxdatab[,"bid"] > 0.0 ) & ( fxdatab[,"ask"] > 0.0 )  

fxdatac<-structure(c(0, 4, 0, 4, 0, 4, 0, 4), .Dim = c(4, 2), .Dimnames
= list(
    NULL, c("bid", "ask")))
fxdatab<-fxdatac[(( fxdatab[,"bid"] > 0.0 ) & ( fxdatac[,"ask"]  > 0.0

temp<-( fxdatac[,"bid"] > 0.0 ) & ( fxdatac[,"ask"] > 0.0 ) print(temp) print(length(temp)) print(sum(temp)) -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This is not research and is not from MS Research but it may refer to a research analyst/research report. Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls. You should not use e-mail to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via ! e-mail will be processed in a timely manner. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules). [[alternative HTML version deleted]] ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Sat Oct 28 12:01:39 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 28 Oct 2006 - 02:30:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.