Re: [Rd] Minimum of an ordered factor

2011-01-06 Thread Kurt Hornik
Martin Maechler writes: I have 3 comments: Thaler, Thorn, LAUSANNE, Applied Mathematics thorn.tha...@rdls.nestle.com on Wed, 5 Jan 2011 11:20:47 +0100 writes: Hi everybody, Is there a particular reason, why this code does not work as intended: z - factor(LETTERS[1:3], ordered =

Re: [Rd] scoping/non-standard evaluation issue

2011-01-06 Thread Kenn Konstabel
the following seems an easy solution: f1 - function(mod){ subs - 1:10 toeval - quote(update(mod, subset=subs)) toeval$subset-subs eval(toeval) } f1(mod.2) When experimenting with this I once had (by mistake): mod.2 - lm(update(mod.1, . ~ . - Year + Year)) # instead of

Re: [Rd] scoping/non-standard evaluation issue

2011-01-06 Thread peter dalgaard
On Jan 6, 2011, at 13:11 , Kenn Konstabel wrote: the following seems an easy solution: f1 - function(mod){ subs - 1:10 toeval - quote(update(mod, subset=subs)) toeval$subset-subs eval(toeval) } f1(mod.2) Tere, Kenn! Yes, enforcing pass-by-value by pre-evaluating

Re: [Rd] Minimum of an ordered factor

2011-01-06 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Kurt Hornik writes if (!all(sapply(args, is.ordered)) || !all(sapply(level.list, identical, y = level.set))) { I think it would be better to use something like ll - lapply(args, levels) !all(sapply(ll, identical, ll[[1L]])) [using union() is not quite right] Yes definitely.

[Rd] trivial typo in R language definition manual

2011-01-06 Thread Ben Bolker
on line 1714 of R-lang.texi (current SVN of R-devel, 53919) @code{x$aa} will match @code{x$aabb} if @code{x} does not a component should probably have contain or have inserted after not __ R-devel@r-project.org mailing list

[Rd] formula(model.frame(y~.^2, data=d)) does not return formula from terms attribute of the model.frame

2011-01-06 Thread William Dunlap
In R 2.12.0 I get d - data.frame(x=1:10, y=log(1:10), f3=LETTERS[rep(1:3,c(3,3,4))]) m - model.frame(y~.^2, data=d) formula(m) y ~ x + f3 In S+ formula(m) gives formula given to model.frame(), but in R you have to do the following get that formula: formula(attr(m, terms)) y ~ (x +

[Rd] Indexing request

2011-01-06 Thread David Winsemius
I just tried ?Constants at the console and was disappointed that the so-named base help page would not come up. ?Constants No documentation for 'Constants' in specified packages and libraries: you could try '??Constants' Seems like there should have been a match. I was looking for the

Re: [Rd] Indexing request

2011-01-06 Thread Steven McKinney
Yes, odd that ?Constants doesn't work, given that there is a page labeled Constants {base}. On a happier note, these all work now on my Mac R version 2.11.1 ?base ?stats ?utils though Constants is not an entry in the index. R help gurus - is it possible to have entries such as Constants