Re: [Rd] stopifnot() suggestion

2006-03-02 Thread Prof Brian Ripley
On Thu, 2 Mar 2006, Martin Maechler wrote: >> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> >> on Thu, 2 Mar 2006 06:45:39 + (GMT) writes: > >BDR> stopifnot() is not intended for use by end-users, but for tests in >BDR> packages. > > and additionally for "function writers

[Rd] problem with as.table (PR#8652)

2006-03-02 Thread I . J . Wilson
# Your mailer is set to "none" (default on Windows), # hence we cannot send the bug report directly from R. # Please copy the bug report (after finishing it) to # your favorite email program and send it to # # [EMAIL PROTECTED] # ## There

[Rd] '...' passed to both plot() and legend()

2006-03-02 Thread Dimitris Rizopoulos
Dear R-devels, I'd like to create a plot method for a class of objects that passes the '...' argument to both plot() and legend(), e.g., x <- list(data = rnorm(1000)) class(x) <- "foo" plot.foo <- function(x, legend = FALSE, cx = "topright", cy = NULL, ...){ dx <- sort(x$data) plot(dx,

Re: [Rd] '...' passed to both plot() and legend()

2006-03-02 Thread Prof Brian Ripley
See e.g. graphics:::plot.POSIXct, which contains axisInt <- function(x, type, main, sub, xlab, ylab, col, lty, lwd, xlim, ylim, bg, pch, log, asp, axes, frame.plot, ...) axis.POSIXct(1, x, ...) You could use such as wrapper for legend, in your case probably to pick out jus

[Rd] minor oddity in pdf() help page

2006-03-02 Thread Roger D. Peng
The following paragraph from ?pdf struck me as a bit odd: 'pdf' writes uncompressed PDF. It is primarily intended for producing PDF graphics for inclusion in other documents, and PDF-includers such as 'pdftex' are usually able to handle compression. Should that be "...and

Re: [Rd] problem with as.table (PR#8652)

2006-03-02 Thread Peter Dalgaard
[EMAIL PROTECTED] writes: > # Your mailer is set to "none" (default on Windows), > # hence we cannot send the bug report directly from R. > # Please copy the bug report (after finishing it) to > # your favorite email program and send it to > # > # [EMAIL PROTECTED] > # >

Re: [Rd] '...' passed to both plot() and legend()

2006-03-02 Thread Gabor Grothendieck
You can remove the legend names, assuming there are none that are also plot names, like this (untested): args <- list(...) legnams <- intersect(names(args), names(formals(legend))] do.call("plot", replace(args, legnams, NULL)) On 3/2/06, Dimitris Rizopoulos <[EMAIL PROTECTED]> wrote: > Dear R-de

Re: [Rd] minor oddity in pdf() help page

2006-03-02 Thread Hin-Tak Leung
Roger D. Peng wrote: > The following paragraph from ?pdf struck me as a bit odd: > > 'pdf' writes uncompressed PDF. It is primarily intended for > producing PDF graphics for inclusion in other documents, and > PDF-includers such as 'pdftex' are usually able to handle > com

Re: [Rd] minor oddity in pdf() help page

2006-03-02 Thread Prof Brian Ripley
No, it means what it actually says. If you include R's PDF in another application, the latter will usually compress *if you asked the application for compressed PDF*. On Thu, 2 Mar 2006, Hin-Tak Leung wrote: > Roger D. Peng wrote: >> The following paragraph from ?pdf struck me as a bit odd: >>

Re: [Rd] minor oddity in pdf() help page

2006-03-02 Thread Roger D. Peng
Okay, it might be the early morning hour---when I read it a second time it made sense. -roger Prof Brian Ripley wrote: > No, it means what it actually says. > > If you include R's PDF in another application, the latter will usually > compress *if you asked the application for compressed PDF*.

Re: [Rd] minor oddity in pdf() help page

2006-03-02 Thread Hin-Tak Leung
Prof Brian Ripley wrote: > No, it means what it actually says. > > If you include R's PDF in another application, the latter will usually > compress *if you asked the application for compressed PDF*. Hmm, no, I don't know about "another application", but pdftex actually tries to insert the graph

[Rd] Named parameters in optim()

2006-03-02 Thread Duncan Murdoch
If I name the elements of the vector of initial values passed to optim(), then it attaches the names to the final result, e.g. > f <- function(parms) (parms[1]-1)^2+(parms[2]-2)^2 > optim(c(x=3,y=4), f) $par x y 0.635 2.0003241 $value [1] 1.063637e-07 $counts function gra

Re: [Rd] Named parameters in optim()

2006-03-02 Thread Prof Brian Ripley
I think the cost is small, and have just added this. On Thu, 2 Mar 2006, Duncan Murdoch wrote: > If I name the elements of the vector of initial values passed to > optim(), then it attaches the names to the final result, e.g. > > > f <- function(parms) (parms[1]-1)^2+(parms[2]-2)^2 > > optim(c(x=

Re: [Rd] Named parameters in optim()

2006-03-02 Thread Duncan Murdoch
On 3/2/2006 2:52 PM, Prof Brian Ripley wrote: > I think the cost is small, and have just added this. Thank you! Duncan Murdoch > > On Thu, 2 Mar 2006, Duncan Murdoch wrote: > >> If I name the elements of the vector of initial values passed to >> optim(), then it attaches the names to the final