David, 
 
Thanks a lot!!!  It works,and that's what I need.  Good night.
 
Sean

________________________________

From: David Winsemius [mailto:dwinsemius@comcast.net]
Sent: Wed 9/1/2010 9:50 PM
To: Xiang Li
Cc: r-help@r-project.org
Subject: Re: [R] How to access some elements of a S4 object?




On Sep 1, 2010, at 10:04 PM, Xiang Li wrote:

> Hi,
>
> Could you please tell me how to access the elements of a S4 object?
>
> Slot "alpha.name":
>
> [1] "Cutoff"
>
>
>
>> perf@alpha.values
>
> [[1]]
>
>  [1]         Inf 0.991096434 0.984667270 0.984599159 0.983494405
> 0.970641299 0.959417835 0.945548941 0.943432189

If that is the print() result of:

perf@alpha.values    # then it's probably an ordinary list with a 
single vector element, so just try

perf@alpha.values[[1]][2]

(The str function also works on S4 objects .)

--
David.


David Winsemius, MD
West Hartford, CT




	[[alternative HTML version deleted]]

