I've been asked to close this thread "in public"
> "TH" == Turner, Heather <[EMAIL PROTECTED]>
> on Wed, 22 Aug 2007 10:20:21 +0100 writes:
TH> Petr Savicky kindly brought this thread to my attention
TH> as I'm afraid it had passed me by. As one of the
TH> contributors to
tr Savicky
Sent: 08 August 2007 07:54
To: r-devel@r-project.org
Subject: Re: [Rd] sweep sanity checking?
Thanks to Martin Maechler for his comments, advice and for pointing
out the speed problem. Thanks also to Ben Bolker for tests of speed,
which confirm that for small arrays, a slow down by a
Thanks to Martin Maechler for his comments, advice and for pointing
out the speed problem. Thanks also to Ben Bolker for tests of speed,
which confirm that for small arrays, a slow down by a factor of about
1.2 - 1.5 may occur. Now, I would like to present a new version of sweep,
which is simpler a
When I was preparing the patch of sweep submitted on July 25, I was
unaware of the code by Heather Turner. She suggested a very elegant
solution, if STATS is a vector and we want to use meaningful recycling
in full generality. I would like to suggest a combined solution, which
uses Heather Turner's
I would like to suggest a patch against R-devel-2007-07-24, which
modifies function sweep by including a warning, if dim(STATS) is not
consistent with dim(x)[MARGIN]. If check.margin=FALSE, the simple test whether
prod(dim(x)[MARGIN]) is a multiple of length(STATS) is performed.
If check.margin=TRU
I would like to suggest a replacement for the curent function
sweep based on the two previous suggestions posted at
https://stat.ethz.ch/pipermail/r-help/2005-June/073989.html
and
http://wiki.r-project.org/rwiki/doku.php?id=rdoc:base:sweep
with some extensions.
My suggestion is to use one of t
I am sorry for an incomplete proposal. The stricter check
if (check.margin && any(dims[MARGIN]!=dimstat)) {
was meant to be
if (check.margin && (length(dimstat)!=length(MARGIN) ||
any(dims[MARGIN]!=dimstat))) {
Petr.
__
R-devel@r-project.org
Hi
Brian Ripley, Heather Turner, and myself discussed this
issue at some length in a thread starting 20 June 2005 (how
do folk give a URL that points to a thread?).
The consensus was that adding a warning level option to sweep
was a good idea; Heather posted a version of sweep that implemented
th
The suggestion sounds reasonable to me. Let me add that sweep is written
to work even if MARGIN includes more than one dimension. To handle these
cases correctly, the test may be replaced e.g. by
if (check.margin && prod(dims[MARGIN])!=length(STATS)) {
warning("length(STATS) != prod(dim
Just an opinion from an R user: I think it's a sound idea. I use my own
version of sweep with a stricter check: it stops if the vector is not
exactly the right length.
-- Tony Plate
Ben Bolker wrote:
> Ben Bolker zoo.ufl.edu> writes:
>
>
>> What would R-core think of the following 'enhan
Ben Bolker zoo.ufl.edu> writes:
> What would R-core think of the following 'enhanced'
> sweep?
(now posted at
http://wiki.r-project.org/rwiki/doku.php?id=rdoc:base:sweep
)
It always warns if dim(x)[MARGIN] is
> not a multiple of length(STATS) {it's very hard indeed
> for me to think of a s
A friend of mine just got bitten by the fact that
sweep() will happily sweep out a STATS vector
of an arbitrary length -- even one whose length
is not a divisor of any of the margins -- without
complaining. I know the answer to this could
be "well just don't do that", but it's easy to make
a mi
12 matches
Mail list logo