Re: [Rd] S4 methods for "+"

2006-08-29 Thread Robin Hankin
On 25 Aug 2006, at 12:56, Prof Brian Ripley wrote: > Just like any other S4 method: > > setMethod("+", c("track", "track"), > function(e1, e2) new("track", x=c([EMAIL PROTECTED], [EMAIL > PROTECTED]), y=c > ([EMAIL PROTECTED],[EMAIL PROTECTED]))) > > If you want to write a group gener

Re: [Rd] PATCH: Add fields argument to installed.packages and available.packages

2006-08-29 Thread Martin Maechler
> "Seth" == Seth Falcon <[EMAIL PROTECTED]> > on Mon, 28 Aug 2006 17:42:39 -0700 writes: Seth> Hi all, The write_PACKAGES function has a 'fields' Seth> argument that allows a user generating a PACKAGES file Seth> to specify additional fields to include. For Seth> symme

[Rd] vector S4 classes

2006-08-29 Thread Robin Hankin
In the Green Book, section 7.5 discusses new vector classes and uses quaternions as an example of a vector class that needs more than one number per element. I would like to define a new class that has a numeric vector and a logical vector of the same length that specifies whether the measur

Re: [Rd] vector S4 classes

2006-08-29 Thread Martin Maechler
> "Robin" == Robin Hankin <[EMAIL PROTECTED]> > on Tue, 29 Aug 2006 10:42:21 +0100 writes: Robin> In the Green Book, section 7.5 discusses new vector classes and uses Robin> quaternions Robin> as an example of a vector class that needs more than one number per Robi

Re: [Rd] vector S4 classes

2006-08-29 Thread Robin Hankin
Hi Martin thanks for this. I see what you say about R not being able to magically subset the "accuracy" slot. Which leaves me puzzled as to why anyone would define a vector class such as "string" (p315). I can't see why "string" is defined as it is, rather than use something like "fungi" fr

Re: [Rd] vector S4 classes

2006-08-29 Thread Gabor Grothendieck
You might want to look at the source for the R 'its' package. It defines an S4 class for an irregular time series whose representation consists of 1. a matrix portion analogous to your vector portion to hold the series of multivariate series, and 2. a "dates" slot analogous to your accurate s

Re: [Rd] PATCH: Add fields argument to installed.packages and available.packages

2006-08-29 Thread Paul Gilbert
Martin Maechler wrote: > ... > >The idea was a field related to but weaker than 'Suggests' : >Something like > 'canMakeUseOf: [, , ... ] >which is *not* used in any QA/QC checking, but is purely >informative: If is require()able, then some examples may >look nicer, a function may provide ano

Re: [Rd] 'CanMakeUseOf' field [was ".. Add 'fields' argument ..]

2006-08-29 Thread Martin Maechler
> "PaulG" == Paul Gilbert <[EMAIL PROTECTED]> > on Tue, 29 Aug 2006 09:55:09 -0400 writes: PaulG> Martin Maechler wrote: >> ... >> >> The idea was a field related to but weaker than 'Suggests' : >> Something like >> 'canMakeUseOf: [, , ... ] >> which is *n

Re: [Rd] 'CanMakeUseOf' field [was ".. Add 'fields' argument ..]

2006-08-29 Thread Pfaff, Bernhard Dr.
>> "PaulG" == Paul Gilbert <[EMAIL PROTECTED]> >> on Tue, 29 Aug 2006 09:55:09 -0400 writes: > >PaulG> Martin Maechler wrote: >>> ... >>> >>> The idea was a field related to but weaker than 'Suggests' : >>> Something like >>> 'canMakeUseOf: [, , ... ] >>> w

Re: [Rd] PATCH: Add fields argument to installed.packages and available.packages

2006-08-29 Thread Seth Falcon
Martin Maechler <[EMAIL PROTECTED]> writes: > I like the idea and will look into applying the patch > (note there's at least one typo which makes "make check" fail: > /priotiry/) Great. Sorry for the typo, I've sent an update privately. > A propos: > > A while back (in last summer?), we (some o

[Rd] Capturing warnings with capture.output

2006-08-29 Thread hadley wickham
Is there any way to include warnings in the output from capture.output? eg: a <- capture.output(warning("test")) all.equal(a, "Warning message: \n test ") Conceptually, this seems like redirecting stderr to stdout, or somehow changing warning to simple print it's output. I've had a look at tryC

Re: [Rd] 'CanMakeUseOf' field [was ".. Add 'fields' argument ..]

2006-08-29 Thread McGehee, Robert
CanUse? If the 'Suggests' field "lists packages that are not necessarily needed" (Writing R Extensions), then why is the user required to have the package installed to pass R CMD check? Likewise, if a CanMakeUseOf field is added, then why would one choose to use Suggests at all? That is, is there

Re: [Rd] PATCH: Add fields argument to installed.packages and available.packages

2006-08-29 Thread Gabor Grothendieck
Rather than a plethora of fields, perhaps the Depends field could indicate what depends on the object: For example, if we use file extensions to indicate what is dependent then one might write this to indicate that some .Rd (i.e. examples) and .Rnw (i.e. vignette) files depend on lattice and the e

Re: [Rd] Capturing warnings with capture.output

2006-08-29 Thread Gabor Grothendieck
Something like this which displays the warnings and also writes them to out so that they are captured: out <- capture.output( withCallingHandlers({ print(1) warning("A warning.") print(2) warning("Another warning.") print(3) }, warning = function(x) ca

[Rd] arguments to boxplot( ) not passed to bxp() (PR#9183)

2006-08-29 Thread sego
Full_Name: Landon Sego Version: 2.3.1 OS: Windows Submission from: (NULL) (130.20.54.241) # When calling boxplot(), shouldn't the "axes" and "frame.plot" # arguments get passed down to bxp()? # Two examples where the "frame.plot" and "axes" arguments # don't seem to work the way one would anti

Re: [Rd] 'CanMakeUseOf' field [was ".. Add 'fields' argument ..]

2006-08-29 Thread Duncan Murdoch
On 8/29/2006 10:12 AM, Martin Maechler wrote: >> "PaulG" == Paul Gilbert <[EMAIL PROTECTED]> >> on Tue, 29 Aug 2006 09:55:09 -0400 writes: > > PaulG> Martin Maechler wrote: > >> ... > >> > >> The idea was a field related to but weaker than 'Suggests' : > >> Somethi

Re: [Rd] 'CanMakeUseOf' field

2006-08-29 Thread Seth Falcon
Duncan Murdoch <[EMAIL PROTECTED]> writes: > I think we need an option to R CMD check rather than a new field in the > DESCRIPTION. Currently a package could be mentioned for any of these > reasons: > > 1. To make functions, examples or vignettes work > 2. To allow optional functionality in fu

Re: [Rd] 'CanMakeUseOf' field

2006-08-29 Thread Duncan Murdoch
On 8/29/2006 11:58 AM, Seth Falcon wrote: > Duncan Murdoch <[EMAIL PROTECTED]> writes: >> I think we need an option to R CMD check rather than a new field in the >> DESCRIPTION. Currently a package could be mentioned for any of these >> reasons: >> >> 1. To make functions, examples or vignettes

Re: [Rd] 'CanMakeUseOf' field [was ".. Add 'fields' argument ..]

2006-08-29 Thread Paul Gilbert
Duncan Murdoch wrote: > On 8/29/2006 10:12 AM, Martin Maechler wrote: > >>> "PaulG" == Paul Gilbert <[EMAIL PROTECTED]> >>> on Tue, 29 Aug 2006 09:55:09 -0400 writes: >> >> >> PaulG> Martin Maechler wrote: >> >> ... >> >> >> The idea was a field related to but wea

Re: [Rd] 'CanMakeUseOf' field [was ".. Add 'fields' argument ..]

2006-08-29 Thread Duncan Murdoch
On 8/29/2006 1:05 PM, Paul Gilbert wrote: > > Duncan Murdoch wrote: > >> On 8/29/2006 10:12 AM, Martin Maechler wrote: >> "PaulG" == Paul Gilbert <[EMAIL PROTECTED]> on Tue, 29 Aug 2006 09:55:09 -0400 writes: >>> >>> >>> PaulG> Martin Maechler wrote: >>> >> ... >

Re: [Rd] 'CanMakeUseOf' field

2006-08-29 Thread Seth Falcon
Duncan Murdoch <[EMAIL PROTECTED]> writes: > On 8/29/2006 11:58 AM, Seth Falcon wrote: >> I think there is an important distinction between a dependency needed >> for the package to function and a dependency needed to demonstrate >> said functionality via an example or vignette. The former is what

Re: [Rd] 'CanMakeUseOf' field

2006-08-29 Thread Paul Gilbert
Seth Falcon wrote: >Duncan Murdoch <[EMAIL PROTECTED]> writes: > > >>On 8/29/2006 11:58 AM, Seth Falcon wrote: >> >> >>>I think there is an important distinction between a dependency needed >>>for the package to function and a dependency needed to demonstrate >>>said functionality via an exa

Re: [Rd] 'CanMakeUseOf' field

2006-08-29 Thread Duncan Murdoch
On 8/29/2006 2:24 PM, Paul Gilbert wrote: > Seth Falcon wrote: > >>Duncan Murdoch <[EMAIL PROTECTED]> writes: >> >> >>>On 8/29/2006 11:58 AM, Seth Falcon wrote: >>> >>> I think there is an important distinction between a dependency needed for the package to function and a dependency

Re: [Rd] Speed of runif() on different Operating Systems

2006-08-29 Thread Prof Brian Ripley
No one else seems to have responded to this. Please see `Writing R Extensions' for how to time things in R. For things like this, the fine details of how well the compiler keeps the pipelines and cache filled are important, as is the cache size and memory speed. Using system.time(for (i in 1:

Re: [Rd] 'CanMakeUseOf' field

2006-08-29 Thread Paul Gilbert
Duncan Murdoch wrote: > On 8/29/2006 2:24 PM, Paul Gilbert wrote: > >> Seth Falcon wrote: >> >>> Duncan Murdoch <[EMAIL PROTECTED]> writes: >>> >>> On 8/29/2006 11:58 AM, Seth Falcon wrote: > I think there is an important distinction between a dependency needed > for

Re: [Rd] 'CanMakeUseOf' field

2006-08-29 Thread Duncan Murdoch
On 8/29/2006 4:13 PM, Paul Gilbert wrote: > > Duncan Murdoch wrote: > >> On 8/29/2006 2:24 PM, Paul Gilbert wrote: >> >>> Seth Falcon wrote: >>> Duncan Murdoch <[EMAIL PROTECTED]> writes: > On 8/29/2006 11:58 AM, Seth Falcon wrote: > > >> I think there is an im

[Rd] list and pairlist in "Writing R Extensions" (PR#9185)

2006-08-29 Thread gah4
Full_Name: Glen Herrmannsfeldt Version: 2.2.1 OS: Linux Submission from: (NULL) (128.95.113.77) Following the discussion in "Writing R Extensions" in section 5.8.2, there is no indication that showArgs expects a pairlist() instead of a list(). I was trying .Call("showArgs",list(one=1,two=2,thr

[Rd] rgamma gives zeros. (PR#9184)

2006-08-29 Thread pxi
Full_Name: Peiyi Xi Version: R 2.2.0 OS: Windows XP Professional Submission from: (NULL) (128.2.3.141) When I use rgamma(n, shape, rate ) to generate gamma samples, it gives zeros when both shape and rate are very small. But we know that if x follows a gamma distribution, x should be positive.

Re: [Rd] list and pairlist in "Writing R Extensions" (PR#9185)

2006-08-29 Thread ripley
It says clearly that showArgs is for use by .External, not .Call (it is introduced in a paragraph about the differences): @example showArgs <- function(...) .External("showArgs", ...) @end example and that is the main user error here. Pairlists are not needed when used as documented. On Wed,