Re: [R] simple save question

From: Terry Therneau <therneau_at_mayo.edu>
Date: Wed, 06 Apr 2011 07:49:51 -0500

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?

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



R-help_at_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. Received on Wed 06 Apr 2011 - 12:52:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 06 Apr 2011 - 13:20:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive