Jeff Enos | 1 Nov 01:04 2005

[Rd] S4 classes in existing packages

R-devel,

I'm interested in looking at some examples of existing R packages that
rely heavily on S4 classes to get a feel for varying styles and
package organization techniques.  Could you recommend any packages
that might serve as a good starting point?

Thanks in advance,

Jeff

______________________________________________
R-devel <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Seth Falcon | 1 Nov 02:25 2005

Re: [Rd] S4 classes in existing packages

On 31 Oct 2005, jeff <at> kanecap.com wrote:
> I'm interested in looking at some examples of existing R packages
> that rely heavily on S4 classes to get a feel for varying styles and
> package organization techniques.  Could you recommend any packages
> that might serve as a good starting point?

I would look at the Matrix package.

+ seth

______________________________________________
R-devel <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Matthias Kohl | 1 Nov 09:01 2005
Picon

Re: [Rd] S4 classes in existing packages

Jeff Enos schrieb:

>R-devel,
>
>I'm interested in looking at some examples of existing R packages that
>rely heavily on S4 classes to get a feel for varying styles and
>package organization techniques.  Could you recommend any packages
>that might serve as a good starting point?
>
>Thanks in advance,
>
>Jeff
>  
>
our packages distr, distrEx, distrSim, distrTEst and RandVar are based 
on S4 classes and methods.

hth
Matthias

>______________________________________________
>R-devel <at> r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-devel
>  
>

--

-- 
StaMatS - Statistik + Mathematik Service
Dipl.Math.(Univ.) Matthias Kohl
www.stamats.de
(Continue reading)

Prof Brian Ripley | 1 Nov 09:18 2005
Picon
Picon

Re: [Rd] S4 classes in existing packages

On Tue, 1 Nov 2005, Matthias Kohl wrote:

> Jeff Enos schrieb:
>
>> R-devel,
>>
>> I'm interested in looking at some examples of existing R packages that
>> rely heavily on S4 classes to get a feel for varying styles and
>> package organization techniques.  Could you recommend any packages
>> that might serve as a good starting point?
>>
>> Thanks in advance,
>>
>> Jeff
>>
>>
> our packages distr, distrEx, distrSim, distrTEst and RandVar are based
> on S4 classes and methods.

As do many others, providing the variety of styles that the questioner 
asked for.  Those that are documented to do so include

CoCo DBI IDPmisc Matrix RMySQL ROracle RSQLite RUnit SparseM aod arules 
boolean coin colorspace copula deal dynamicGraph fBasics(etc) flexclust 
flexmix giRaph gpclib its kappalab kernalb limma lme4 matlab monoProc 
orientlib partsm pixmap tuneR

on CRAM, stats4 in the R sources and most (all?) of BioC.

--

-- 
(Continue reading)

Pfaff, Bernhard Dr. | 1 Nov 09:33 2005

Re: [Rd] S4 classes in existing packages

> Jeff Enos schrieb:
>
>> R-devel,
>>
>> I'm interested in looking at some examples of existing R packages that
>> rely heavily on S4 classes to get a feel for varying styles and
>> package organization techniques.  Could you recommend any packages
>> that might serve as a good starting point?
>>
>> Thanks in advance,
>>
>> Jeff
>>
>>
> our packages distr, distrEx, distrSim, distrTEst and RandVar are based
> on S4 classes and methods.

As do many others, providing the variety of styles that the questioner 
asked for.  Those that are documented to do so include

CoCo DBI IDPmisc Matrix RMySQL ROracle RSQLite RUnit SparseM aod arules 
boolean coin colorspace copula deal dynamicGraph fBasics(etc) flexclust 
flexmix giRaph gpclib its kappalab kernalb limma lme4 matlab monoProc 
orientlib partsm pixmap tuneR

on CRAM, stats4 in the R sources and most (all?) of BioC.

--

-- 
Brian D. Ripley,                  ripley <at> stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
(Continue reading)

Prof Brian Ripley | 1 Nov 11:58 2005
Picon
Picon

Re: [Rd] Yates' correction for continuity in chisq.test (PR#8265)

On Mon, 31 Oct 2005, Prof Brian Ripley wrote:

> On Sun, 30 Oct 2005, P Ehlers wrote:
>
>> dih69530 <at> syd.odn.ne.jp wrote:
>>> Full_Name: foo ba baz
>>> Version: R2.2.0
>>> OS: Mac OS X (10.4)
>>> Submission from: (NULL) (219.66.32.183)
>>> 
>>> 
>>> chisq.test(matrix(c(9,10,9,11),2,2))
>>> 
>>> Chi-square value must be 0, and, P value must be 0
>>> R does over correction
>>> 
>>> when | a d - b c | < n / 2 &#65292;chi-sq must be 0
>> 
>> (Presumably, you mean P-value = 1.)
>> If you don't want the correction, set correct=FALSE. (The
>> results won't differ much.)
>> 
>> A better example is
>> 
>>  chisq.test(matrix(c(9,10,9,10),2,2))
>> 
>> for which R probably should return X-squared = 0.
>
> R is using the correction that almost all the sources I looked at suggest. 
> You can't go around adjusting X^2 for just some values of the data: the claim 
(Continue reading)

Duncan Murdoch | 1 Nov 15:16 2005
Picon

Re: [Rd] [R] unvectorized option for outer()

The version I posted yesterday did indeed mess up when some arguments 
were unspecified.  Here's a revision that seems to work in all the tests 
I can think of.  I also added the SIMPLIFY and USE.NAMES args from 
mapply to it, and a sanity check to the args.

I did notice and work around one buglet in mapply:  if you choose not to 
vectorize any arguments, you don't get a call to the original function, 
mapply returns "list()".

For example,

 > mapply(function(x) x^2, MoreArgs = list(x=2))
list()

whereas I would think 4 is a more logical answer.

Vectorize <- function(FUN, vectorize.args = arg.names, SIMPLIFY = TRUE, 
USE.NAMES = TRUE) {

     arg.names <- as.list(formals(FUN))
     arg.names[["..."]] <- NULL
     arg.names <- names(arg.names)

     vectorize.args <- as.character(vectorize.args)

     if (!length(vectorize.args)) return(FUN)

     if (!all(vectorize.args %in% arg.names))
	stop("must specify formal argument names to vectorize")

(Continue reading)

Thomas Lumley | 1 Nov 16:16 2005

Re: [Rd] [R] unvectorized option for outer()

On Tue, 1 Nov 2005, Duncan Murdoch wrote:

> The version I posted yesterday did indeed mess up when some arguments were 
> unspecified.  Here's a revision that seems to work in all the tests I can 
> think of.  I also added the SIMPLIFY and USE.NAMES args from mapply to it, 
> and a sanity check to the args.
>
> I did notice and work around one buglet in mapply:  if you choose not to 
> vectorize any arguments, you don't get a call to the original function, 
> mapply returns "list()".
>
> For example,
>
>> mapply(function(x) x^2, MoreArgs = list(x=2))
> list()
>
> whereas I would think 4 is a more logical answer.
>

I don't agree at all.  The answer should be the length of the longest 
vectorised argument, and it is.

 	-thomas

______________________________________________
R-devel <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

kin.chan | 1 Nov 16:18 2005
Picon

[Rd] spyware detected (PR#8270)

Gentlemen:

I ran a spyware sweep on my computer after installing:

10/07/2005  03:25 PM        27,230,914 R-2.2.0-win32.exe

>From the cran website.

Spy Sweeper 4.0.3 with the latest definition files found

Directory of C:\Program Files\R\R-2.2.0

11/01/2005  09:27 AM           668,938 unins000.exe

To have the golden eye signature.  This is serious if indeed the uninstall
program contains the golden eye monitor program.

Please look into this and update me with developments.

Thank you,

Kin Chan

______________________________________________
R-devel <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Jeff Enos | 1 Nov 16:51 2005

Re: [Rd] S4 classes in existing packages

Thanks to Dirk Eddelbuettel, Matthias Kohl, Professor Ripley, and
Bernhard Pfaff for their helpful reponses.

Here is a list of the packages they recommended:

CRAN: distr distrEx distrSim distrTEst RandVar CoCo DBI IDPmisc Matrix
RMySQL ROracle RSQLite RUnit SparseM aod arules boolean coin
colorspace copula deal dynamicGraph fBasics(etc) flexclust flexmix
giRaph gpclib its kappalab kernalb limma lme4 matlab monoProc
orientlib partsm pixmap tuneR urca

R sources: stats4

BoiC: most/all

Which of these are thought (by the community as a whole) to use S4
classes in a method/style that less experienced programmers like me
should try to learn from and emulate?

Thanks,

Jeff

Prof Brian Ripley writes:
 > On Tue, 1 Nov 2005, Matthias Kohl wrote:
 > 
 > > Jeff Enos schrieb:
 > >
 > >> R-devel,
 > >>
(Continue reading)


Gmane