Trev101
2008-Aug-07 07:56 UTC
[R] Trying to run simple survival program in R but does not work
Hey, I am just starting to learn R now and I typed in this simple survival program: library(survival) t <- c(10,13,18,19,23,30,36,38,54,56,59,75,93,97,104,107,107,107) c <- c(1,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0) data <- Surv(t,c) km <- survfit(data) summary(km) Call: survfit(formula = data) but everytime I run it I get this error: Error in eval.with.vis(expr, envir, enclos) : object "Call" not found Can someone please help me out I really have no idea wat I have done wrong. I have installed the survival library is there maybe some other library I need to install? -- View this message in context: http://www.nabble.com/Trying-to-run-simple-survival-program-in-R-but-does-not-work-tp18865807p18865807.html Sent from the R help mailing list archive at Nabble.com.
bartjoosen
2008-Aug-07 08:50 UTC
[R] Trying to run simple survival program in R but does not work
When I run your code, I have no problem at all, could you please give us some more info about what system you are running on, OS, packages loaded, ..... Bart Trev101 wrote:> > Hey, > > I am just starting to learn R now and I typed in this simple survival > program: > > library(survival) > t <- c(10,13,18,19,23,30,36,38,54,56,59,75,93,97,104,107,107,107) > c <- c(1,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0) > data <- Surv(t,c) > km <- survfit(data) > summary(km) > Call: survfit(formula = data) > > but everytime I run it I get this error: > > Error in eval.with.vis(expr, envir, enclos) : object "Call" not found > > Can someone please help me out I really have no idea wat I have done > wrong. I have installed the survival library is there maybe some other > library I need to install? >-- View this message in context: http://www.nabble.com/Trying-to-run-simple-survival-program-in-R-but-does-not-work-tp18865807p18866431.html Sent from the R help mailing list archive at Nabble.com.
Trev101
2008-Aug-07 09:01 UTC
[R] Trying to run simple survival program in R but does not work
Very Strange have no idea why this is happening :-( I am running a AMD Athlon 64 3500+ with 1 GB RAM and Running microsoft Windows XP service pack 2. I only installed the main program of R being R-2.7.1-win32 and then I installed tinn-R. I then opened R and tinn-R and then from the RGui I went to packages, install packages, choose the CRAN mirror in South Africa and then went down to survival and installed that package. I thought that was all package I would need to install. Is there something else that I must install? Thanx for all the help I really hope to sort this problem out. -- View this message in context: http://www.nabble.com/Trying-to-run-simple-survival-program-in-R-but-does-not-work-tp18865807p18866594.html Sent from the R help mailing list archive at Nabble.com.
Trev101
2008-Aug-07 09:09 UTC
[R] Trying to run simple survival program in R but does not work
Oh wait it gives me another error saying that: Loading required package: splines I cant find the package called splines in the list is that an important package? -- View this message in context: http://www.nabble.com/Trying-to-run-simple-survival-program-in-R-but-does-not-work-tp18865807p18866689.html Sent from the R help mailing list archive at Nabble.com.
bartjoosen
2008-Aug-07 09:40 UTC
[R] Trying to run simple survival program in R but does not work
Survival depends on splines, so you should install the splines library, and then everything should be fine. Bart Trevor Hansen wrote:> > Oh wait it gives me another error saying that: > Loading required package: splines > > I cant find the package called splines in the list is that an important > package? >-- View this message in context: http://www.nabble.com/Trying-to-run-simple-survival-program-in-R-but-does-not-work-tp18865807p18867071.html Sent from the R help mailing list archive at Nabble.com.
Trevor Hansen
2008-Aug-07 09:43 UTC
[R] Trying to run simple survival program in R but does not work
Hey, Thanx I did that and it works it gives me the output I require but it still does not like that call option I guess its not that important since I got the output I required :-D. Thanx for all the help I really appreciate it :-D -- View this message in context: http://www.nabble.com/Trying-to-run-simple-survival-program-in-R-but-does-not-work-tp18865807p18867112.html Sent from the R help mailing list archive at Nabble.com.
Prof Brian Ripley
2008-Aug-07 09:50 UTC
[R] Trying to run simple survival program in R but does not work
On Thu, 7 Aug 2008, Trev101 wrote:> > Hey, > > I am just starting to learn R now and I typed in this simple survival > program: > > library(survival) > t <- c(10,13,18,19,23,30,36,38,54,56,59,75,93,97,104,107,107,107) > c <- c(1,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0) > data <- Surv(t,c) > km <- survfit(data) > summary(km) > Call: survfit(formula = data) > > but everytime I run it I get this error: > > Error in eval.with.vis(expr, envir, enclos) : object "Call" not found > > Can someone please help me out I really have no idea wat I have done wrong.You have pasted in part of the output of 'summary(km)': R does not understand its own output, only its language.> I have installed the survival library is there maybe some other library I > need to install? > -- > View this message in context: http://www.nabble.com/Trying-to-run-simple-survival-program-in-R-but-does-not-work-tp18865807p18865807.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Tomas Lanczos
2008-Aug-07 10:34 UTC
[R] Trying to run simple survival program in R but does not work
Trev101 wrote:> Hey, > > I am just starting to learn R now and I typed in this simple survival > program: > > library(survival) > t <- c(10,13,18,19,23,30,36,38,54,56,59,75,93,97,104,107,107,107) > c <- c(1,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0) > data <- Surv(t,c) > km <- survfit(data) > summary(km) > Call: survfit(formula = data) > > but everytime I run it I get this error: > > Error in eval.with.vis(expr, envir, enclos) : object "Call" not found > > Can someone please help me out I really have no idea wat I have done wrong. > I have installed the survival library is there maybe some other library I > need to install >Don't capitalise the "Call" command, use "call" instead. Good luck! tomas p.s.: am I right if I suppose that You are using Windows? ;-)
Duncan Murdoch
2008-Aug-07 12:30 UTC
[R] Trying to run simple survival program in R but does not work
On 07/08/2008 3:56 AM, Trev101 wrote:> Hey, > > I am just starting to learn R now and I typed in this simple survival > program: > > library(survival) > t <- c(10,13,18,19,23,30,36,38,54,56,59,75,93,97,104,107,107,107) > c <- c(1,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0) > data <- Surv(t,c) > km <- survfit(data) > summary(km) > Call: survfit(formula = data) > > but everytime I run it I get this error: > > Error in eval.with.vis(expr, envir, enclos) : object "Call" not found > > Can someone please help me out I really have no idea wat I have done wrong. > I have installed the survival library is there maybe some other library I > need to install?The last line, "Call: survfit(formula = data)", is not R code. It is the first line of the output you should expect to see, i.e. > library(survival) Loading required package: splines > t <- c(10,13,18,19,23,30,36,38,54,56,59,75,93,97,104,107,107,107) > c <- c(1,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0) > data <- Surv(t,c) > km <- survfit(data) > summary(km) Call: survfit(formula = data) time n.risk n.event survival std.err lower 95% CI upper 95% CI 10 18 1 0.944 0.0540 0.844 1.000 19 15 1 0.881 0.0790 0.739 1.000 30 13 1 0.814 0.0978 0.643 1.000 36 12 1 0.746 0.1107 0.558 0.998 59 8 1 0.653 0.1303 0.441 0.965 75 7 1 0.559 0.1412 0.341 0.917 93 6 1 0.466 0.1452 0.253 0.858 97 5 1 0.373 0.1430 0.176 0.791 107 3 1 0.249 0.1392 0.083 0.745 Duncan Murdoch