Re: [Rd] Trouble with ifelse and if statement (PR#7962)

2005-06-22 Thread Martin Maechler
   
   

Marc> This is not a bug and yes you have missed something.

Marc> Read R FAQ 7.31 Why doesn't R think these numbers are equal?

Marc> More information is also available here:

Marc> http://grouper.ieee.org/groups/754/

thank you, Marc.

Marc> One possible solution:

>> i
Marc> [1] 0.08 0.00 0.33 0.00 0.00 0.00 0.00 0.33 0.00 0.00 0.08 0.08 0.20
Marc> [14] 0.00 0.13

Note that a slightly more recommended way for the following is

  as.integer(sapply(i, function(x) isTRUE(all.equal(x, 0.33

using theisTRUE(all.equal(...))  idiom 
which I'd recommend quite generally.

Martin

>> ifelse(sapply(i, function(x) all.equal(x, 0.33)) == "TRUE", 1, 0)
Marc> [1] 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0

>> ifelse(sapply(i, function(x) all.equal(x, 0.08)) == "TRUE", 1, 0)
Marc> [1] 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0

>> ifelse(sapply(i, function(x) all.equal(x, 0.2)) == "TRUE", 1, 0)
Marc> [1] 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0

Martin

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Trouble with ifelse and if statement (PR#7962)

2005-06-22 Thread Gabor Grothendieck
On 6/22/05, Martin Maechler <[EMAIL PROTECTED]> wrote:
> 
>   
> 
>Marc> This is not a bug and yes you have missed something.
> 
>Marc> Read R FAQ 7.31 Why doesn't R think these numbers are equal?
> 
>Marc> More information is also available here:
> 
>Marc> http://grouper.ieee.org/groups/754/
> 
> thank you, Marc.
> 
>Marc> One possible solution:
> 
>>> i
>Marc> [1] 0.08 0.00 0.33 0.00 0.00 0.00 0.00 0.33 0.00 0.00 0.08 0.08 0.20
>Marc> [14] 0.00 0.13
> 
> Note that a slightly more recommended way for the following is
> 
>  as.integer(sapply(i, function(x) isTRUE(all.equal(x, 0.33
> 
> using theisTRUE(all.equal(...))  idiom
> which I'd recommend quite generally.

Perhaps it should be added to the 7.31 FAQ answer.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Lapack calls from fortran

2005-06-22 Thread Paul Gilbert
I am trying to call the lapack routine dgesv in the R distribution from 
the fortran code for a package, but when I dyn.load("dse1.so") I get an 
error about undefined symbol: dgesv_

I thought the proper incantation was

MAKEFLAG="FLIBS=/path to/R-2.1.1/libRlapack.so" R CMD SHLIB dse1.f

but apparantly not. How does one do this?

Thanks,
Paul

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Suggestion for the R Bugs web page

2005-06-22 Thread Marc Schwartz
Hi all,

I would like to recommend that the following text from the R Posting
Guide be placed on the R Bug submission page in the section "Submit New
Reports", which would read as follows:

Submit New Reports

You can submit new bug reports either using an online form by clicking
on the button below or by sending email to [EMAIL PROTECTED] 

Before you post a real bug report, make sure you read R Bugs in the
R-faq. If you're not completely and utterly sure something is a bug,
post a question to r-help, not a bug report to r-bugs - every bug report
requires manual action by one of the R-core members.

If you wish to comment upon an existing report, you cannot do that via
the web interface. Instead send an email to the above address with the
Subject: header containing (PR#999) -- replace 999 with actual report
number, of course.



Perhaps reading that brief middle section, without having to click to
another page, will help to reduce user error reports going to R Bugs and
save members of R Core some time.



Also, as a quick pointer, I noted that there is a repeated word ("for")
on the R Home Page in the "Getting Started" box:

R is a free software environment _for for_ statistical computing and
graphics. It compiles and runs on a wide variety of UNIX platforms,
Windows and MacOS. To download R, please choose your preferred CRAN
mirror.


Best regards,

Marc Schwartz

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Lapack calls from fortran

2005-06-22 Thread Douglas Bates
On 6/22/05, Paul Gilbert <[EMAIL PROTECTED]> wrote:
> I am trying to call the lapack routine dgesv in the R distribution from
> the fortran code for a package, but when I dyn.load("dse1.so") I get an
> error about undefined symbol: dgesv_
> 
> I thought the proper incantation was
> 
> MAKEFLAG="FLIBS=/path to/R-2.1.1/libRlapack.so" R CMD SHLIB dse1.f
> 
> but apparantly not. How does one do this?

See section 1.2.1 of "Writing R Extensions".  You should add a file
called Makevars to the src directory and include the line

PKG_LIBS = ${LAPACK_LIBS} ${BLAS_LIBS}

in that file

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Suggestion for the R Bugs web page

2005-06-22 Thread Martin Maechler
Thank you, Marc, for your suggestion.

> "Marc" == Marc Schwartz <[EMAIL PROTECTED]>
> on Wed, 22 Jun 2005 10:15:00 -0500 writes:

Marc> Hi all,
Marc> I would like to recommend that the following text from the R Posting
Marc> Guide be placed on the R Bug submission page in the section "Submit 
New
Marc> Reports", which would read as follows:

Marc> Submit New Reports

Marc> You can submit new bug reports either using an online form by clicking
Marc> on the button below or by sending email to [EMAIL PROTECTED] 

actually, nobody should advertize that e-mail (but maybe those
at ku.dk, when they talk about it inside DK), 
but rather  [EMAIL PROTECTED] .

The advantage of the latter is its "genericity" and the fact
that mails are filtered a bit more.

Marc> Before you post a real bug report, make sure you read R Bugs in the
Marc> R-faq. If you're not completely and utterly sure something is a bug,
Marc> post a question to r-help, not a bug report to r-bugs - every bug 
report
Marc> requires manual action by one of the R-core members.

Marc> If you wish to comment upon an existing report, you cannot do that via
Marc> the web interface. Instead send an email to the above address with the
Marc> Subject: header containing (PR#999) -- replace 999 with actual report
Marc> number, of course.



Marc> Perhaps reading that brief middle section, without having to click to
Marc> another page, will help to reduce user error reports going to R Bugs 
and
Marc> save members of R Core some time.

Note that we (well, primarily Peter Dalgaard) have considered
complete changes to the R-bugs "system" anyway some of which
would obliterate the e-mail interface completely IIRC.


Marc> Also, as a quick pointer, I noted that there is a repeated word 
("for")
Marc> on the R Home Page in the "Getting Started" box:

> R is a free software environment _for for_ statistical computing and
> graphics. It compiles and runs on a wide variety of UNIX platforms,
> Windows and MacOS. To download R, please choose your preferred CRAN
> mirror.

I've fixed that one --- haven't checked for how many months this
has remained unreported

Thank you, Marc!
Martin

Marc> Best regards,

Marc> Marc Schwartz

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Suggestion for the R Bugs web page

2005-06-22 Thread Marc Schwartz
On Wed, 2005-06-22 at 18:51 +0200, Martin Maechler wrote:
> Thank you, Marc, for your suggestion.

My pleasure Martin.

> > "Marc" == Marc Schwartz <[EMAIL PROTECTED]>
> > on Wed, 22 Jun 2005 10:15:00 -0500 writes:
> 
> Marc> Hi all,
> Marc> I would like to recommend that the following text from the R Posting
> Marc> Guide be placed on the R Bug submission page in the section "Submit 
> New
> Marc> Reports", which would read as follows:
> 
> Marc> Submit New Reports
> 
> Marc> You can submit new bug reports either using an online form by 
> clicking
> Marc> on the button below or by sending email to [EMAIL PROTECTED] 
> 
> actually, nobody should advertize that e-mail (but maybe those
> at ku.dk, when they talk about it inside DK), 
> but rather  [EMAIL PROTECTED] .
> 
> The advantage of the latter is its "genericity" and the fact
> that mails are filtered a bit more.

That e-mail above (biostat.ku.dk) is the one presently on the R Bugs
page (both the text and the mailto: link).

> Marc> Before you post a real bug report, make sure you read R Bugs in the
> Marc> R-faq. If you're not completely and utterly sure something is a bug,
> Marc> post a question to r-help, not a bug report to r-bugs - every bug 
> report
> Marc> requires manual action by one of the R-core members.
> 
> Marc> If you wish to comment upon an existing report, you cannot do that 
> via
> Marc> the web interface. Instead send an email to the above address with 
> the
> Marc> Subject: header containing (PR#999) -- replace 999 with actual 
> report
> Marc> number, of course.
> 
> 
> 
> Marc> Perhaps reading that brief middle section, without having to click 
> to
> Marc> another page, will help to reduce user error reports going to R 
> Bugs and
> Marc> save members of R Core some time.
> 
> Note that we (well, primarily Peter Dalgaard) have considered
> complete changes to the R-bugs "system" anyway some of which
> would obliterate the e-mail interface completely IIRC.

Bugzilla?  ;-)

JitterBug of course is no longer actively maintained by the Samba folks.

> Marc> Also, as a quick pointer, I noted that there is a repeated word 
> ("for")
> Marc> on the R Home Page in the "Getting Started" box:
> 
> > R is a free software environment _for for_ statistical computing and
> > graphics. It compiles and runs on a wide variety of UNIX platforms,
> > Windows and MacOS. To download R, please choose your preferred CRAN
> > mirror.
> 
> I've fixed that one --- haven't checked for how many months this
> has remained unreported
> 
> Thank you, Marc!
> Martin

You are welcome Martin. I don't often go to the main page, as I have
specific pages bookmarked in Firefox. It just happened to catch my eye.

Marc

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] efficiency of sample() with prob.

2005-06-22 Thread Bo Peng
On 6/21/05, Vadim Ogranovich <[EMAIL PROTECTED]> wrote:
> In his "Introduction to Probability Models" Sheldon Ross describes (sec
> 11.4.1, 8th edition) the alias method for such weighted sampling.
> It is based on some decomposition of the original distribution (the
> weights) into a mixture of two-point distributions. 

This sounds like Walker's alias method for weighted sampling. I looked
through Knoth's 'the art of computer programming' and find this
algorithm. I implemented this one but it is just as efficient as the
bisection lookup method in my case. The reason is that the setup of
this algorithm is complicated so it is suited for getting large sample
from short weighted sequences. Anyway, I do suggest R developers try
this algorithm for sample with replacement. A sample code can be found
at http://statistik.wu-wien.ac.at/arvag/monograph/arvag-src/algo03_03.c
.

BTW, does anyone know a quicker algorithm to set up the internal table
of the alias method?

Bo

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Suggestion for the R Bugs web page

2005-06-22 Thread Peter Dalgaard
Marc Schwartz <[EMAIL PROTECTED]> writes:

> > Note that we (well, primarily Peter Dalgaard) have considered
> > complete changes to the R-bugs "system" anyway some of which
> > would obliterate the e-mail interface completely IIRC.
> 
> Bugzilla?  ;-)
> 
> JitterBug of course is no longer actively maintained by the Samba folks.

X-actly. No need for the smiley. Apart from the maintenance issue, we
also have the problem of spam injection, aggravated by the fact that
Jitterbug is chopping headers off incoming mail, so that it looks like
it comes from us. We did get blackholed at one point - the entire
pubhealth department...

It would be a no-brainer to switch to Bugzilla, were it not for the
3000 or so messages that are already sitting in the Jitterbug
database.  

-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Suggestion for the R Bugs web page

2005-06-22 Thread Marc Schwartz
On Wed, 2005-06-22 at 21:15 +0200, Peter Dalgaard wrote:
> Marc Schwartz <[EMAIL PROTECTED]> writes:
> 
> > > Note that we (well, primarily Peter Dalgaard) have considered
> > > complete changes to the R-bugs "system" anyway some of which
> > > would obliterate the e-mail interface completely IIRC.
> > 
> > Bugzilla?  ;-)
> > 
> > JitterBug of course is no longer actively maintained by the Samba folks.
> 
> X-actly. No need for the smiley. Apart from the maintenance issue, we
> also have the problem of spam injection, aggravated by the fact that
> Jitterbug is chopping headers off incoming mail, so that it looks like
> it comes from us. We did get blackholed at one point - the entire
> pubhealth department...

Ouch. That's not good.

Perhaps that's one of many reasons that the Samba folks themselves have
switched to Bugzilla?

> It would be a no-brainer to switch to Bugzilla, were it not for the
> 3000 or so messages that are already sitting in the Jitterbug
> database.  

Might the python script linked at the follow Bugzilla report be of use?

https://bugzilla.mozilla.org/show_bug.cgi?id=124869

See the attachment in Comment #1:

https://bugzilla.mozilla.org/attachment.cgi?id=69233

as the author's web site link appears to be offline. I don't know
python, so I would defer to others with more expertise as to whether the
above is useful "as is", or might serve as a starting point.

Marc

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Suggestion for the R Bugs web page

2005-06-22 Thread Peter Dalgaard
Marc Schwartz <[EMAIL PROTECTED]> writes:

> On Wed, 2005-06-22 at 21:15 +0200, Peter Dalgaard wrote:
> > Marc Schwartz <[EMAIL PROTECTED]> writes:
> > 
> > > > Note that we (well, primarily Peter Dalgaard) have considered
> > > > complete changes to the R-bugs "system" anyway some of which
> > > > would obliterate the e-mail interface completely IIRC.
> > > 
> > > Bugzilla?  ;-)
> > > 
> > > JitterBug of course is no longer actively maintained by the Samba folks.
> > 
> > X-actly. No need for the smiley. Apart from the maintenance issue, we
> > also have the problem of spam injection, aggravated by the fact that
> > Jitterbug is chopping headers off incoming mail, so that it looks like
> > it comes from us. We did get blackholed at one point - the entire
> > pubhealth department...
> 
> Ouch. That's not good.

Fortunately, we got pulled out of the hole relatively fast, because
Duncan Murdoch knew the mechanisms. And fortunately, not every
recipient uses those blackhole lists.
 
> Perhaps that's one of many reasons that the Samba folks themselves have
> switched to Bugzilla?

Andrew Tridgell will have known about the lack of maintenance for a
while... The idea of putting a public mailing list into the loop
wasn't part of the original design. The code to prevent duplicates
from messages sent to both r-bugs and r-devel was a local hack.

> > It would be a no-brainer to switch to Bugzilla, were it not for the
> > 3000 or so messages that are already sitting in the Jitterbug
> > database.  
> 
> Might the python script linked at the follow Bugzilla report be of use?
> 
> https://bugzilla.mozilla.org/show_bug.cgi?id=124869
> 
> See the attachment in Comment #1:
> 
> https://bugzilla.mozilla.org/attachment.cgi?id=69233
> 
> as the author's web site link appears to be offline. I don't know
> python, so I would defer to others with more expertise as to whether the
> above is useful "as is", or might serve as a starting point.

Yes, I got the bright idea of googling for "jitterbug bugzilla" just
after replying as well... It does look quite useful. Not that I speak
Python either (Monty excepted), but the scheme he has been converting
from - status encoded in the directory name - is quite similar to our
slightly simpler Foo/Foo-fixed convention.

-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Rgui bug in Windows: leftover download dialog (PR#7964)

2005-06-22 Thread murdoch
In Windows, if a download is interrupted (by switching to the console 
window and hitting ESC), the download status dialog can be left 
onscreen, with no apparent way to get rid of it (other than stopping and 
restarting R).

To duplicate:

Run this:

a <- available.packages()
download.packages(a, 'c:/temp')

Then, during a particularly long download, switch to the console window 
and hit ESC.

This affects R-devel, as well as 2.1.1.

Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] efficiency of sample() with prob.

2005-06-22 Thread Prof Brian Ripley
You might recall the message

 R is a collaborative project with many contributors.

We suggest that you take up your own suggestion, research this area and 
offer the R project the results of your research for consideration as your 
contribution.

It seems likely that in sample(x, size, replace = TRUE, prob) the optimal 
method depends on both the size of 'x' and 'size' and perhaps to a lesser 
extent on 'prob'.  (That's what my book on the subject shows.)

On Wed, 22 Jun 2005, Bo Peng wrote:

> On 6/21/05, Vadim Ogranovich <[EMAIL PROTECTED]> wrote:
>> In his "Introduction to Probability Models" Sheldon Ross describes (sec
>> 11.4.1, 8th edition) the alias method for such weighted sampling.
>> It is based on some decomposition of the original distribution (the
>> weights) into a mixture of two-point distributions.
>
> This sounds like Walker's alias method for weighted sampling. I looked
> through Knoth's 'the art of computer programming' and find this
> algorithm. I implemented this one but it is just as efficient as the
> bisection lookup method in my case. The reason is that the setup of
> this algorithm is complicated so it is suited for getting large sample
> from short weighted sequences. Anyway, I do suggest R developers try
> this algorithm for sample with replacement. A sample code can be found
> at http://statistik.wu-wien.ac.at/arvag/monograph/arvag-src/algo03_03.c
> .
>
> BTW, does anyone know a quicker algorithm to set up the internal table
> of the alias method?

Quicker than what?  See the discussion in my Stochastic Simulation book 
for `quicker than Walker'.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Suggestion for the R Bugs web page

2005-06-22 Thread Marc Schwartz
On Wed, 2005-06-22 at 22:06 +0200, Peter Dalgaard wrote:
> Marc Schwartz <[EMAIL PROTECTED]> writes:
> 
> > On Wed, 2005-06-22 at 21:15 +0200, Peter Dalgaard wrote:
> > > It would be a no-brainer to switch to Bugzilla, were it not for the
> > > 3000 or so messages that are already sitting in the Jitterbug
> > > database.  
> > 
> > Might the python script linked at the follow Bugzilla report be of use?
> > 
> > https://bugzilla.mozilla.org/show_bug.cgi?id=124869
> > 
> > See the attachment in Comment #1:
> > 
> > https://bugzilla.mozilla.org/attachment.cgi?id=69233
> > 
> > as the author's web site link appears to be offline. I don't know
> > python, so I would defer to others with more expertise as to whether the
> > above is useful "as is", or might serve as a starting point.
> 
> Yes, I got the bright idea of googling for "jitterbug bugzilla" just
> after replying as well... It does look quite useful. Not that I speak
> Python either (Monty excepted), but the scheme he has been converting
> from - status encoded in the directory name - is quite similar to our
> slightly simpler Foo/Foo-fixed convention.


Well, hopefully that might work with only modest alteration then,
enabling a less painful transition. Pending further review of course...

Marc

"Follow. But! Follow only if ye be men of valor, for the entrance to
this cave is guarded by a creature so foul, so cruel that no man yet has
fought with it and lived! Bones of full fifty men lie strewn about its
lair. So, brave knights, if you do doubt your courage or your strength,
come no further, for death awaits you all with nasty, big, pointy
teeth."

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel