[R] simple save question

Terry Therneau therneau at mayo.edu
Wed Apr 6 14:49:51 CEST 2011

--- begin inclusion--

When I run the survfit function, I want to get the restricted mean  
value and the standard error also. I found out using the "print"  
function to do so, as shown below,

The questions is, is there any way to extract these values from the  
print command?

-----  end inclusion ---

Use sfit <- summary(fit).  Then sfit$table contains the data the the
print method produces.
No, there isn't a way to extract them from the print command; the
standard in S/R is for all print commands to return the object passed to
them, without embellisment.

Terry Therneau

More information about the R-help mailing list