[R] Data.frame issue (pls help)

2010-03-08 Thread GULATI, BRIJESH (Global Markets FFO NY)
Hi: 
I want to obtain a particular value from a data.frame. Following is my
dataframe:

 Quotes
BID ASK
Name
CT2 GOVT99.9296999.9375 CT2
TUM0 COMDTY 108.53125   108.5469TUM0
CT5 GOVT100.10156   100.1094GT5
FVM0 COMDTY 115.56250   115.5703FVM0
TYM0 COMDTY 116.93750   116.9531TYM0

If I try to run: QuoteTUM0BID = Quotes[Quotes$Name %in% TUM0, BID]
and print QuoteTUM0BID, I get 108.5312, instead of 108.53125 as an
answer. Please let me know why is it ignoring the last digit. 


Additional Information. 
If I run QuoteBID = Quotes[, BID], I get the whole array in which TUM0
BID is 108.53125 (a correct number).


Thanks in advance...
Rgds,
Brijesh



--
This message w/attachments (message) may be privileged, ...{{dropped:30}}

__
R-help@r-project.org 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.


Re: [R] Data.frame issue (pls help)

2010-03-08 Thread Ivan Calandra

Hi,

I cannot really test since your dataframe is completely distorted, but 
what happens if you try: format(QuoteBID, nsmall=5)?
I think it's just a matter of printing, which uses the number of digits 
from options(digits=).


See: ?options, ?format, etc.

But I'm not an expert and cannot really test for this.
HTH
Ivan

Le 3/8/2010 14:15, GULATI, BRIJESH (Global Markets FFO NY) a écrit :

Hi:
I want to obtain a particular value from a data.frame. Following is my
dataframe:

   

Quotes
 

BID ASK
Name
CT2 GOVT99.9296999.9375 CT2
TUM0 COMDTY 108.53125   108.5469TUM0
CT5 GOVT100.10156   100.1094GT5
FVM0 COMDTY 115.56250   115.5703FVM0
TYM0 COMDTY 116.93750   116.9531TYM0

If I try to run: QuoteTUM0BID = Quotes[Quotes$Name %in% TUM0, BID]
and print QuoteTUM0BID, I get 108.5312, instead of 108.53125 as an
answer. Please let me know why is it ignoring the last digit.


Additional Information.
If I run QuoteBID = Quotes[, BID], I get the whole array in which TUM0
BID is 108.53125 (a correct number).


Thanks in advance...
Rgds,
Brijesh



--
This message w/attachments (message) may be privileged, ...{{dropped:30}}

__
R-help@r-project.org 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.

   


--
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calan...@uni-hamburg.de

**
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php

__
R-help@r-project.org 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.