File: nested.Rout.save

package info (click to toggle)
survival 2.36-14-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,500 kB
  • sloc: asm: 7,352; ansic: 5,369; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 1,136 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(survival)
Loading required package: splines
> #
> # A test of nesting.  It makes sure tha model.frame is built correctly
> #
> tfun <- function(fit, mydata) {
+     survfit(fit, newdata=mydata)
+     }
> 
> myfit <- coxph(Surv(time, status) ~ age + factor(sex), lung)
> 
> temp1 <- tfun(myfit, lung[1:5,])
> temp2 <- survfit(myfit, lung[1:5,])
> indx <- match('call', names(temp1))  #the call components won't match
> 
> all.equal(unclass(temp1)[-indx], unclass(temp2)[-indx])
[1] TRUE
> 
>