Hi there, can anyone tell me how to extract to values of a particular slot for 
some S4 object? Let take following example:

> library(fOptions)
> val <-GBSOption(TypeFlag = "c", S = 60, X = 65, Time = 1/4, r = 0.08, b = 
> 0.08, sigma = 0.30)
> val

Title:
 Black Scholes Option Valuation 

Call:
 GBSOption(TypeFlag = "c", S = 60, X = 65, Time = 1/4, r = 0.08, 
     b = 0.08, sigma = 0.3)

Parameters:
          Value:
 TypeFlag c     
 S        60    
 X        65    
 Time     0.25  
 r        0.08  
 b        0.08  
 sigma    0.3   

Option Price:
 2.133372 

Description:
 Sat Nov 06 19:25:39 2010 

Here I have tried with following however slapped with some error:


> val@"Option Price"
Error: no slot of name "Option Price" for this object of class "fOPTION"

What is the ideal way to do that?

Thanks,

______________________________________________
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.

Reply via email to