[R] errores

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jan 7 19:06:12 CET 1999

On Thu, 7 Jan 1999, Peter B. Mandeville wrote:

> Happy New Year to all,
> I am using RW0631 and WIN98.
> 	1. The command DATA only works for the base library. 

Not so. It works for the MASS library, for example, in that version of R.

> 	2. The following code on page 312 of Venables and Ripley 1997

I really think I am wasting my time trying to help R users. In the VR
bundle from which you got the Sitka data (even though you claim
data(Sitka) did not work) is a set of scripts modified to run under R,
and there are on-line complements for `R'. PLEASE USE THEM.

You cannot reasonably expect a book about S-PLUS to work unchanged on R,
especially one finished in 1996 to work on R as it has become in 1999.
There is a fair chance that the 1999 3rd edition will work with 
minimal changes on current R.

> sitka.lme <-
> lme(size~treat*ordered(Time),random=~1,cluster=~tree,data=Sitka,
> serial.structure="ar1.continuous",serial.covariate=~Time)
> produced the following error message
> Error in lme(size ~ treat * ordered(Time), random = ~1, cluster = ~tree, :
> unused argument to function

That example is for S-PLUS, not R. See the scripts for the changes. Doug
Bates has pointed out one way to do: this is one of those cases where
lme-2.9 has a different interface from any S version (2.1 or 3.0). 

> birthwt.step2 <-
> step(birthwt.glm,~.^2+I(scale(age)^2)+I(scale(lwt)^2),trace=F)
> produced the following warning message 8 times
> Warning: ignored non function "scale"

Yes, an R scoping problem.  The example works, though.  Current S-PLUS is
clever enough to know that a function is required, so one never gets that

> 	4. The following code on page 358 of Venables and Venables 1997 
Uh Oh. Try reading the cover once again.

> plot(survfit(leuk.coxs),lty=2:3,lwd=3,add=T,log=T)

Please read the instructions (on page 357, or in the R version of the
scripts): you need library(MASS) loaded after library(survival4),
to make sure MASS is found first. 

> Finally, is if possible to automatically load libraries when R is started
> and if so how?

Put them in .Rprofile: see our on-line complements for one source of info.
As it says

If there are commands that you want to have invoked for each session
(like \sfn{library(MASS)}, of course), you can put these in a file
called \sfn{.Rprofile}. This searched for first in the current
directory then in the user's home directory, but only the first file
found (if any) is read in.

That is true for rw0631 too: earlier Windows versions used Rprofile.

Peter, we have repeated ask you for a signature, as your reply address
is invalid. My patience at having to post replies to you is wearing 
rather thin. Please be a good net citizen and give us a valid reply
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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

More information about the R-help mailing list