mikalzet@libero.it
2002-Mar-21 07:47 UTC
[Rd] Small typo in An Introduction to R (PR#1402)
At a snail's pace I keep on translating an introduction to R into italian; I have reached the section describing the glm() function, in which some example code is presented. The very last line of code, before the beginning of the section on Poisson models is: ldp <- ld50(coef(fmp)); ldl <- ld50(coef(fmp)); c(ldp, ldl) which of course gives results 43.663 and 43.663; the correct code should be: ldp <- ld50(coef(fmp)); ldl <- ld50(coef(fml)); c(ldp, ldl) which gives the expected results 43.663 and 43.601 -- Michele Alzetta -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi, The following is a small test function that is part of a larger piece of code. If I understand things correctly both z and st.obj$call need to be looked for in .GlobalEnv . How do I write this so it works? And which part of the documentation should I be reading to get a more in depth explanation? Thanks Nicholas tst<- function(st.obj,z){ G<-unique(st.obj$mem[,st.obj$depth]) Gr<-st.obj$mem[,st.obj$depth] cphlst<-list() for(i in G){ assign("form",deparse(substitute(st.obj$cph.call)),env=.GlobalEnv) dat<-z[Gr==i,] call<-paste("coxph(",form ,",data= ",dat,")") cphlst[[j]]<-eval(parse(text=call), sys.parent()) } cphlst } CH3 | N Nicholas Lewin-Koh / \ Dept of Statistics N----C C==O Program in Ecology and Evolutionary Biology || || | Iowa State University || || | Ames, IA 50011 CH C N--CH3 http://www.public.iastate.edu/~nlewin \ / \ / nlewin at iastate.edu N C | || Currently CH3 O Graphics Lab School of Computing National University of Singapore The Real Part of Coffee kohnicho at comp.nus.edu.sg -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
maechler@stat.math.ethz.ch
2002-Mar-22 17:01 UTC
[Rd] Small typo in An Introduction to R (PR#1402)
Thank you, Michele. I've fixed it now. Martin>>>>> "Michele" == Michele Alzetta <mikalzet@libero.it> writes:Michele> At a snail's pace I keep on translating an Michele> introduction to R into italian; I have reached the Michele> section describing the glm() function, in which Michele> some example code is presented. The very last line Michele> of code, before the beginning of the section on Michele> Poisson models is: Michele> ldp <- ld50(coef(fmp)); ldl <- ld50(coef(fmp)); c(ldp, ldl) Michele> ........ the correct code should Michele> be: Michele> ldp <- ld50(coef(fmp)); ldl <- ld50(coef(fml)); c(ldp, ldl) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._