David, Thanks a lot!!! It works,and that's what I need. Good night. Sean
________________________________ From: David Winsemius [mailto:dwinsem...@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" > > > >> p...@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: p...@alpha.values # then it's probably an ordinary list with a single vector element, so just try p...@alpha.values[[1]][2] (The str function also works on S4 objects .) -- David. David Winsemius, MD West Hartford, CT [[alternative HTML version deleted]] ______________________________________________ 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.