Re: [Rd] R 64 on Intel Mac check problem

2008-03-26 Thread Bill Northcott
On 27/03/2008, at 11:51 AM, Simon Urbanek wrote:
> Yes, the gcc-4.2 is known to be broken for x86_64 as you describe  
> above (or in fact it miscompiles a few other things, too).  
> Interestingly llvm-gcc-4.2 suffers from the same problem. That is  
> the reason why the 64-bit binaries are currently not offered.
> Switching to gcc-4.0 breaks other things on other targets, so there  
> is no universal (and maintainable) solution that I'm aware of.

Perhaps we could all file an enhancement bug request to release an  
updated version of the compiler.

Do Apple know that llvm-gcc is affected?

Bill

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


Re: [Rd] R 64 on Intel Mac check problem

2008-03-26 Thread Simon Urbanek

On Mar 26, 2008, at 8:05 PM, Bill Northcott wrote:

> On 26/03/2008, at 10:00 PM, Georgios wrote:
>> I have installed gcc 4.2 and gfortran 4.2 from the available sources
>> on the
>> web page and am using the copy and paste guide on the page.
>>
>> Now everything seems to be going fine until the point where the R
>> packages
>> are tested. In particular when the regression tests are run I get the
>> following.
>>
>> running regression tests
>> running code in 'reg-tests-1.R' ...\c
>> OK
>> running code in 'reg-tests-2.R' ...\c
>> OK
>> comparing 'reg-tests-2.Rout' to './reg-tests-2.Rout.save' ...\c
>> 3756c3756
>> <   The decimal point is 1 digit(s) to the right of the |
>> ---
>>> The decimal point is at the |
>> 3762c3762
>
> It may or may not be relevant, but there is a catastrophic bug in
> log10() in 10.5.2 for x86_64: it returns 0 for all arguments.  This
> has been discussed on the Scitech list.  Apple think they have fixed
> it, but I am sure they would want to hear of other cases or possible
> compiler issues, if it is their compiler you are using.
>
> So if you can get a minimal test case it would be very good to submit
> a bug.  It may be worth doing even if you cannot get a minimal case
> because all the sources are readily available.
>
> Finally last time I looked a few days back Simon's 64 bit Intel builds
> were failing.
>

Yes, the gcc-4.2 is known to be broken for x86_64 as you describe  
above (or in fact it miscompiles a few other things, too).  
Interestingly llvm-gcc-4.2 suffers from the same problem. That is the  
reason why the 64-bit binaries are currently not offered.
Switching to gcc-4.0 breaks other things on other targets, so there is  
no universal (and maintainable) solution that I'm aware of.

Thanks,
Simon

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


Re: [Rd] R 64 on Intel Mac check problem

2008-03-26 Thread Bill Northcott
On 26/03/2008, at 10:00 PM, Georgios wrote:
> I have installed gcc 4.2 and gfortran 4.2 from the available sources  
> on the
> web page and am using the copy and paste guide on the page.
>
> Now everything seems to be going fine until the point where the R  
> packages
> are tested. In particular when the regression tests are run I get the
> following.
>
> running regression tests
> running code in 'reg-tests-1.R' ...\c
> OK
> running code in 'reg-tests-2.R' ...\c
> OK
> comparing 'reg-tests-2.Rout' to './reg-tests-2.Rout.save' ...\c
> 3756c3756
> <   The decimal point is 1 digit(s) to the right of the |
> ---
>>  The decimal point is at the |
> 3762c3762

It may or may not be relevant, but there is a catastrophic bug in  
log10() in 10.5.2 for x86_64: it returns 0 for all arguments.  This  
has been discussed on the Scitech list.  Apple think they have fixed  
it, but I am sure they would want to hear of other cases or possible  
compiler issues, if it is their compiler you are using.

So if you can get a minimal test case it would be very good to submit  
a bug.  It may be worth doing even if you cannot get a minimal case  
because all the sources are readily available.

Finally last time I looked a few days back Simon's 64 bit Intel builds  
were failing.

Bill Northcott

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


[Rd] Google Summer of Code: cross-listing

2008-03-26 Thread Ben Bolker

   Dear R/Google Summer of Code people,

NESCent (the National Evolutionary Synthesis Center) is a Google SoC
organization and has a couple of R-specific projects on its list (I'm
one of the mentors), specifically for phylogenetic/evolutionary biology
problems in R (in fact, the first two projects listed on
http://phyloinformatics.net/Phyloinformatics_Summer_of_Code_2008 )
Would it be possible to
include a link to them on the R project SoC page \
(http://www.r-project.org/SoC08/ ), as that might help people 
specifically looking for R projects to better find it ?
(They are quite different from those listed for R, so  this
shouldn't mean any competition.)

   sincerely
 Ben Bolker

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


Re: [Rd] suppressing 'download.file' progress window

2008-03-26 Thread Roger D. Peng
Thanks!  The patch to src/modules/internet/internet.c in r44937 was just what I 
was looking for.

-roger

Prof Brian Ripley wrote:
> On Wed, 26 Mar 2008, Roger D. Peng wrote:
> 
>> In Windows, 'download.file' pops up a separate window indicating the 
>> progress of the download (even when 'quiet = TRUE').  This is useful 
>> and informative when downloading a single (large) file.  However, when 
>> downloading multiple (smaller) files in sucession, the constant 
>> flashing of the progress window can be a little disorienting (at least 
>> for me).
>>
>> Is there a way to suppress this progress window?  Or is it an 
>> operating system
>> feature?
> 
> The write up was somewhat confusing.  'quiet=TRUE' suppresses the status 
> messages on all platforms, and the (text) progress bar.  Only in R-devel 
> does it suppress the progress bar widget on Windows.
> 
> That said, the main time I download many files is via update.packages() 
> or install.packages(), and there was no provision to set quiet=TRUE from 
> those: I've just added ... to allow that.
> 

-- 
Roger D. Peng  |  http://www.biostat.jhsph.edu/~rpeng/

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


Re: [Rd] suppressing 'download.file' progress window

2008-03-26 Thread Prof Brian Ripley
On Wed, 26 Mar 2008, Roger D. Peng wrote:

> In Windows, 'download.file' pops up a separate window indicating the 
> progress of the download (even when 'quiet = TRUE').  This is useful and 
> informative when downloading a single (large) file.  However, when 
> downloading multiple (smaller) files in sucession, the constant flashing 
> of the progress window can be a little disorienting (at least for me).
>
> Is there a way to suppress this progress window?  Or is it an operating system
> feature?

The write up was somewhat confusing.  'quiet=TRUE' suppresses the status 
messages on all platforms, and the (text) progress bar.  Only in R-devel 
does it suppress the progress bar widget on Windows.

That said, the main time I download many files is via update.packages() or 
install.packages(), and there was no provision to set quiet=TRUE from 
those: I've just added ... to allow that.

-- 
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


[Rd] suppressing 'download.file' progress window

2008-03-26 Thread Roger D. Peng
In Windows, 'download.file' pops up a separate window indicating the progress 
of 
the download (even when 'quiet = TRUE').  This is useful and informative when 
downloading a single (large) file.  However, when downloading multiple 
(smaller) 
files in sucession, the constant flashing of the progress window can be a 
little 
disorienting (at least for me).

Is there a way to suppress this progress window?  Or is it an operating system 
feature?

-roger
-- 
Roger D. Peng  |  http://www.biostat.jhsph.edu/~rpeng/

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


Re: [Rd] S4 slot with NA default

2008-03-26 Thread Prof Brian Ripley
Several people have suggested as.numeric(NA).  That evaluates to NA_real_, 
so provided you don't want to support R < 2.5.0 it is (slightly) more 
efficient in several ways to use NA_real_ .

On Wed, 26 Mar 2008, Roger Bivand wrote:

> On Wed, 26 Mar 2008, Robin Hankin wrote:
>
>> Hi
>>
>> How do I specify an S4 class with a slot that is potentially numeric,
>> but NA
>> by default?  I   want the slot to be NA until I calculate its value
>>  (an expensive operation, not needed for all applications).   When
>> its value is
>> known, I  will create a new object with the correct value inserted in
>> the slot.
>>
>> I want "NA" to signify "not known".
>>
>> My attempt fails because NA is not numeric:
>
> setClass("foo",
>  representation=representation(x="numeric"),
>  prototype=list(x=as.numeric(NA)))
> new("foo")
>
> is OK, we have a character NA prototype in an sp CRS class, and it's never
> been any trouble.
>
> Roger
>
>>
>>>
>> setClass
>> ("foo",representation=representation(x="numeric"),prototype=list(x=NA))
>> Error in makePrototypeFromClassDef(properties, ClassDef, immediate,
>> where) :
>>   in making the prototype for class "foo" elements of the prototype
>> failed to match the corresponding slot class: x (class ?numeric? )
>>>
>>
>> (the real application has other slots too).   I can
>> use "NaN", which is numeric:
>>
>>>
>> setClass
>> ("foo",representation=representation(x="numeric"),prototype=list(x=NaN))
>> [1] "foo"
>>>
>>
>> But this is not the correct sense: to me "NaN" means "not a number"
>> and I want
>> the sense to be "not available".
>>
>>
>>
>> Any advice?
>>
>>
>>
>>
>>
>> --
>> Robin Hankin
>> Uncertainty Analyst and Neutral Theorist,
>> National Oceanography Centre, Southampton
>> European Way, Southampton SO14 3ZH, UK
>>  tel  023-8059-7743
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> --
> Roger Bivand
> Economic Geography Section, Department of Economics, Norwegian School of
> Economics and Business Administration, Helleveien 30, N-5045 Bergen,
> Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
> e-mail: [EMAIL PROTECTED]
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
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] S4 slot with NA default

2008-03-26 Thread Christian Kohler
Hi Robin,

you could try this:
> setClass("foo",
representation=representation(x="numeric"),prototype=list(x=as.numeric(NA)))
> test<-new("foo")
> test
>An object of class "foo"
>Slot "x":
>[1] NA


Cheers,
Christian


Robin Hankin wrote:
> Hi
>
> How do I specify an S4 class with a slot that is potentially numeric,  
> but NA
> by default?  I   want the slot to be NA until I calculate its value
>   (an expensive operation, not needed for all applications).   When  
> its value is
> known, I  will create a new object with the correct value inserted in  
> the slot.
>
> I want "NA" to signify "not known".
>
> My attempt fails because NA is not numeric:
>
>  >  
> setClass 
> ("foo",representation=representation(x="numeric"),prototype=list(x=NA))
> Error in makePrototypeFromClassDef(properties, ClassDef, immediate,  
> where) :
>in making the prototype for class "foo" elements of the prototype  
> failed to match the corresponding slot class: x (class “numeric” )
>  >
>
> (the real application has other slots too).   I can
> use "NaN", which is numeric:
>
>  >  
> setClass 
> ("foo",representation=representation(x="numeric"),prototype=list(x=NaN))
> [1] "foo"
>  >
>
> But this is not the correct sense: to me "NaN" means "not a number"  
> and I want
> the sense to be "not available".
>
>
>
> Any advice?
>
>
>
>
>
> --
> Robin Hankin
> Uncertainty Analyst and Neutral Theorist,
> National Oceanography Centre, Southampton
> European Way, Southampton SO14 3ZH, UK
>   tel  023-8059-7743
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>   


-- 

Christian Kohler
Institute of Functional Genomics
Computational Diagnostics
University of Regensburg (BioPark I)
D-93147 Regensburg (Germany)

Tel. +49 941 943 5055
Fax  +49 941 943 5020
[EMAIL PROTECTED]

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


Re: [Rd] S4 slot with NA default

2008-03-26 Thread Roger Bivand
On Wed, 26 Mar 2008, Robin Hankin wrote:

> Hi
>
> How do I specify an S4 class with a slot that is potentially numeric,
> but NA
> by default?  I   want the slot to be NA until I calculate its value
>  (an expensive operation, not needed for all applications).   When
> its value is
> known, I  will create a new object with the correct value inserted in
> the slot.
>
> I want "NA" to signify "not known".
>
> My attempt fails because NA is not numeric:

setClass("foo",
  representation=representation(x="numeric"),
  prototype=list(x=as.numeric(NA)))
new("foo")

is OK, we have a character NA prototype in an sp CRS class, and it's never 
been any trouble.

Roger

>
> >
> setClass
> ("foo",representation=representation(x="numeric"),prototype=list(x=NA))
> Error in makePrototypeFromClassDef(properties, ClassDef, immediate,
> where) :
>   in making the prototype for class "foo" elements of the prototype
> failed to match the corresponding slot class: x (class ?numeric? )
> >
>
> (the real application has other slots too).   I can
> use "NaN", which is numeric:
>
> >
> setClass
> ("foo",representation=representation(x="numeric"),prototype=list(x=NaN))
> [1] "foo"
> >
>
> But this is not the correct sense: to me "NaN" means "not a number"
> and I want
> the sense to be "not available".
>
>
>
> Any advice?
>
>
>
>
>
> --
> Robin Hankin
> Uncertainty Analyst and Neutral Theorist,
> National Oceanography Centre, Southampton
> European Way, Southampton SO14 3ZH, UK
>  tel  023-8059-7743
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

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


Re: [Rd] S4 slot with NA default

2008-03-26 Thread Peter Dalgaard
Robin Hankin wrote:
> Hi
>
> How do I specify an S4 class with a slot that is potentially numeric,  
> but NA
> by default?  I   want the slot to be NA until I calculate its value
>   (an expensive operation, not needed for all applications).   When  
> its value is
> known, I  will create a new object with the correct value inserted in  
> the slot.
>
> I want "NA" to signify "not known".
>
> My attempt fails because NA is not numeric:
>
>  >  
> setClass 
> ("foo",representation=representation(x="numeric"),prototype=list(x=NA))
> Error in makePrototypeFromClassDef(properties, ClassDef, immediate,  
> where) :
>in making the prototype for class "foo" elements of the prototype  
> failed to match the corresponding slot class: x (class “numeric” )
>  >
>
> (the real application has other slots too).   I can
> use "NaN", which is numeric:
>
>  >  
> setClass 
> ("foo",representation=representation(x="numeric"),prototype=list(x=NaN))
> [1] "foo"
>  >
>
> But this is not the correct sense: to me "NaN" means "not a number"  
> and I want
> the sense to be "not available".
>
>
>
> Any advice?
>
>
>
>   
How about NA_real_ or NA_integer_?


-- 
   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] S4 slot with NA default

2008-03-26 Thread Simon Urbanek

On Mar 26, 2008, at 12:04 PM, Robin Hankin wrote:

> Hi
>
> How do I specify an S4 class with a slot that is potentially numeric,
> but NA
> by default?  I   want the slot to be NA until I calculate its value
>  (an expensive operation, not needed for all applications).   When
> its value is
> known, I  will create a new object with the correct value inserted in
> the slot.
>
> I want "NA" to signify "not known".
>
> My attempt fails because NA is not numeric:
>
>>
> setClass
> ("foo
> ",representation=representation(x="numeric"),prototype=list(x=NA))
> Error in makePrototypeFromClassDef(properties, ClassDef, immediate,
> where) :
>   in making the prototype for class "foo" elements of the prototype
> failed to match the corresponding slot class: x (class “numeric” )
>>
>

Why don't you just initialize x with the correct type then? NA is  
logical, so either use as.numeric(NA) or NA_real_ (see ?NA)

Cheers,
S


> (the real application has other slots too).   I can
> use "NaN", which is numeric:
>
>>
> setClass
> ("foo 
> ",representation=representation(x="numeric"),prototype=list(x=NaN))
> [1] "foo"
>>
>
> But this is not the correct sense: to me "NaN" means "not a number"
> and I want
> the sense to be "not available".
>
>
>
> Any advice?
>
>
>
>
>
> --
> Robin Hankin
> Uncertainty Analyst and Neutral Theorist,
> National Oceanography Centre, Southampton
> European Way, Southampton SO14 3ZH, UK
>  tel  023-8059-7743
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

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


Re: [Rd] S4 slot with NA default

2008-03-26 Thread Vladimir Dergachev
On Wednesday 26 March 2008 12:04:11 pm Robin Hankin wrote:
> Hi
>
> How do I specify an S4 class with a slot that is potentially numeric,
> but NA
> by default?  I   want the slot to be NA until I calculate its value
>   (an expensive operation, not needed for all applications).   When
> its value is
> known, I  will create a new object with the correct value inserted in
> the slot.
>
> I want "NA" to signify "not known".
>
> My attempt fails because NA is not numeric:
>

Try as.numeric(NA) - by default, plain NA is of type "logical"

  best

Vladimir Dergachev

>
>
>
> --
> Robin Hankin
> Uncertainty Analyst and Neutral Theorist,
> National Oceanography Centre, Southampton
> European Way, Southampton SO14 3ZH, UK
>   tel  023-8059-7743
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Vladimir DergachevRCG Ardis Capital LLC

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


[Rd] S4 slot with NA default

2008-03-26 Thread Robin Hankin
Hi

How do I specify an S4 class with a slot that is potentially numeric,  
but NA
by default?  I   want the slot to be NA until I calculate its value
  (an expensive operation, not needed for all applications).   When  
its value is
known, I  will create a new object with the correct value inserted in  
the slot.

I want "NA" to signify "not known".

My attempt fails because NA is not numeric:

 >  
setClass 
("foo",representation=representation(x="numeric"),prototype=list(x=NA))
Error in makePrototypeFromClassDef(properties, ClassDef, immediate,  
where) :
   in making the prototype for class "foo" elements of the prototype  
failed to match the corresponding slot class: x (class “numeric” )
 >

(the real application has other slots too).   I can
use "NaN", which is numeric:

 >  
setClass 
("foo",representation=representation(x="numeric"),prototype=list(x=NaN))
[1] "foo"
 >

But this is not the correct sense: to me "NaN" means "not a number"  
and I want
the sense to be "not available".



Any advice?





--
Robin Hankin
Uncertainty Analyst and Neutral Theorist,
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

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


Re: [Rd] cut.Date and cut.POSIXt problem

2008-03-26 Thread Marc Schwartz
Martin Maechler wrote:
>> "RDP" == Roger D Peng <[EMAIL PROTECTED]>
>> on Wed, 26 Mar 2008 09:18:19 -0400 writes:
> 
> RDP> I have applied these patches to R-devel and in my limited testing 
> they appear to 
> RDP> work as desired.  I have to say that I never ran into the problem 
> these patches 
> RDP> were meant to solve so I may not be the best person to do the 
> testing.
> 
> that must have been an old version of R-devel, since Marc's
> patches had made it "officially" into R-devel on Monday,
> and subsequently also into  R-2.7.0 alpha.
> 
> With thanks to Marc, Brian, Roger and other contributors,
> Martin

Thanks Martin and thanks to Roger, Gabor and Prof. Ripley for taking the 
time to review and commit the patches.

Also note that patches were included to add "quarter[s]" as a defined 
break interval to cut.Date() and cut.POSIXt() and that these patches 
were also made to hist.Date() and hist.POSIXt() so that those functions 
support the new break intervals as well.

The help files for these have also been updated.

Lastly, a patch was added to tests/reg-tests-1.R for the original issue 
raised by Gabor.

Thanks again to everyone.

Regards,

Marc

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


Re: [Rd] cut.Date and cut.POSIXt problem

2008-03-26 Thread Martin Maechler
> "RDP" == Roger D Peng <[EMAIL PROTECTED]>
> on Wed, 26 Mar 2008 09:18:19 -0400 writes:

RDP> I have applied these patches to R-devel and in my limited testing they 
appear to 
RDP> work as desired.  I have to say that I never ran into the problem 
these patches 
RDP> were meant to solve so I may not be the best person to do the testing.

that must have been an old version of R-devel, since Marc's
patches had made it "officially" into R-devel on Monday,
and subsequently also into  R-2.7.0 alpha.

With thanks to Marc, Brian, Roger and other contributors,
Martin

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


Re: [Rd] cut.Date and cut.POSIXt problem

2008-03-26 Thread Roger D. Peng
I have applied these patches to R-devel and in my limited testing they appear 
to 
work as desired.  I have to say that I never ran into the problem these patches 
were meant to solve so I may not be the best person to do the testing.

-roger

Marc Schwartz wrote:
> Hi all,
> 
> Apologies for the delay in my engaging in this thread. I was traveling 
> this week.
> 
> The problem that Gabor raised was caused by the patch that I submitted 
> to fix a problem with the referenced functions when using 'months' and 
> 'years' as the interval. The prior versions were problematic:
> 
>   https://stat.ethz.ch/pipermail/r-devel/2008-January/048004.html
> 
> The patch fixed the error, but since I used hist.Date() as the reference 
> model and did not note the subtle difference in cut.Date() relative to 
> specifying the breaks increment value, this functionality was lost when 
> the same modification was made to the code in cut.Date().
> 
> Roger's patch helps, but does not totally remedy the situation. One also 
> needs to modify the method used for specifying the max value 'end' for 
> the breaks in order to include the max 'x' Date value in the result.
> 
> Hence, I am attaching proposed patches against R-devel for 
> base:::dates.R and base:::datetime.R.
> 
> I am also attaching a patch for tests:::reg-tests-1.R to add a check for 
> this situation to the regression tests that were also added subsequent 
> to that prior set of patches that I had submitted.
> 
> If perhaps Roger and Gabor could so some testing on these patches before 
> they are considered for inclusion into the R-devel tree, it would be 
> helpful to check to see if I have missed something else here.
> 
> Thanks for raising this issue.
> 
> Regards,
> 
> Marc Schwartz
> 
> Roger D. Peng wrote:
>> Seems changes in r44116 force the interval to be single months (or 
>> years) instead of whatever the user specified.  I think the attached 
>> patches correct this.
>>
>> Interestingly, 'cut' and 'seq' allow for the 'breaks' specification to 
>> be something like "3 months" but the documentation for 'hist' does not 
>> allow for this type of specification.
>>
>> -roger
>>
>> Gabor Grothendieck wrote:
>>> cut.Date and cut.POSIXt indicate that the breaks argument
>>> can be an integer followed by a space followed by "year", etc.
>>> but it seems the integer is ignored.
>>>
>>> For example, I assume that breaks = "3 months" is supposed
>>> to cut it into quarters but, in fact, it cuts it into months as if
>>> 3 had not been there.
>>>
 d <- seq(Sys.Date(), length = 12, by = "month")
 cut(d, "3 months")
>>>  [1] 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01 2008-08-01
>>> 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01 2009-02-01
>>> Levels: 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01
>>> 2008-08-01 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01
>>> 2009-02-01
 cut(as.POSIXct(d), "3 months")
>>>  [1] 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01 2008-08-01
>>> 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01 2009-02-01
>>> Levels: 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01
>>> 2008-08-01 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01
>>> 2009-02-01
 cut(as.POSIXlt(d), "3 months")
>>>  [1] 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01 2008-08-01
>>> 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01 2009-02-01
>>> Levels: 2008-03-01 2008-04-01 2008-05-01 2008-06-01 2008-07-01
>>> 2008-08-01 2008-09-01 2008-10-01 2008-11-01 2008-12-01 2009-01-01
>>> 2009-02-01
>>>
> 
> 
> 
> --- datesORIG.R   2008-03-20 14:25:13.0 -0500
> +++ dates.R   2008-03-20 14:38:21.0 -0500
> @@ -322,17 +322,19 @@
>   if(valid == 3) {
>  start$mday <- 1
>  end <- as.POSIXlt(max(x, na.rm = TRUE))
> -end <- as.POSIXlt(end + (31 * 86400))
> +step <- ifelse(length(by2) == 2, as.integer(by2[1]), 1)
> +end <- as.POSIXlt(end + (31 * step * 86400))
>  end$mday <- 1
> -breaks <- as.Date(seq(start, end, "months"))
> +breaks <- as.Date(seq(start, end, breaks))
>  } else if(valid == 4) {
>  start$mon <- 0
>  start$mday <- 1
>  end <- as.POSIXlt(max(x, na.rm = TRUE))
> -end <- as.POSIXlt(end + (366 * 86400))
> +step <- ifelse(length(by2) == 2, as.integer(by2[1]), 1)
> +end <- as.POSIXlt(end + (366 * step * 86400))
>  end$mon <- 0
>  end$mday <- 1
> -breaks <- as.Date(seq(start, end, "years"))
> +breaks <- as.Date(seq(start, end, breaks))
>  } else {
>  start <- .Internal(POSIXlt2Date(start))
>  if (length(by2) == 2) incr <- incr * as.integer(by2[1])
> 
> 
> 
> 
> --- datetimeORIG.R2008-03-20 14:25:20.0 -0500
> +++ datetime.R2008-03-20 15:25:49.0

Re: [Rd] choose fails a fundamental property of binomial coefficients (PR#11035)

2008-03-26 Thread maechler
> "MM" == Martin Maechler <[EMAIL PROTECTED]>
> on Wed, 26 Mar 2008 11:02:37 +0100 (CET) writes:

> "JL" == Jerry Lewis <[EMAIL PROTECTED]>
> on Wed, 26 Mar 2008 05:10:04 +0100 (CET) writes:

  JL> Full_Name: Jerry W. Lewis Version: 2.7.0 (2008-03-23
  JL> r44847) OS: Windows XP Professional Submission from:
  JL> (NULL) (71.184.230.48)


  JL> choose(n,k) = choose(n,n-k) is not satisfied if either

  JL> 1. n is a negative integer with k a positive integer
  JL> (due to automatically returning 0 for n-k<0)


  JL> 2. n is not an integer with k a positive integer (due to
  JL> rounding n-k to an integer, compounded by automatically
  JL> returning 0 if n<0 which implies n-k<0)


MM> I think you have not really understood from help(choose)
MM> that we have

MM> choose(n,k) :=  n(n-1)...(n-k+1) / k!

MM> defined for non-negative integer k and arbitrary real n

MM> This definition has the very important property that it is used
MM> in the 'binomial theorem' and everything depending on that
MM> theorem,

MM> (1 + x) ^ \alpha =  \sum_{k=0}^\infty  choose(x,k) x^k

Oops!  "Of course", I meant   'choose(\alpha,k)' , not 'choose(x,k)'

MM> which holds   for all |x| < 1   for all \alpha \in \R

MM> ---

MM> Your "fundamental" property does only hold when  n is
MM> non-negative integer.

MM> Definitely no bug in R here!

Martin Maechler, ETH Zurich

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


Re: [Rd] DLL problem

2008-03-26 Thread Uwe Ligges


Carson, John wrote:
> I am using R version 2.6.2 (2008-02-08) on an XP Pro (version 2002 SP2). When 
> I try to load the R library 'gtools', I get the following error:
> 
>> library(gtools)
> Error in .Call("R_lazyLoadDBfetch", key, file, compressed, hook, PACKAGE = 
> "base") : 
>   C symbol name "R_lazyLoadDBfetch" not in DLL for package "base"


I guess your version of gtools has been compiled for R < 2.6.0.
Please start R without loading packages and run
   update.packages(checkBuilt = TRUE)
Then try again.

Best wishes,
Uwe Ligges



> Any help or suggestions would be greatly appreciated.
> 
> Best wishes,
> John
> 
> 
> 
> Carson, John, Ph.D.
> Senior Statistician
> Federal Applied Science and Engineering
> Shaw Environmental & Infrastructure Group
> 16406 US Rte. 224 East
> Findlay OH 45840
> 419-425-6156 direct
> 419-425-6085 fax
> Shaw(tm) a world of Solutions(tm) 
> www.shawgrp.com 
>  
> 
> Internet Email Confidentiality Footer
> Privileged/Confidential Information may be contained in this
> message. If you are not the addressee indicated in this message (or
> responsible for delivery of the message to such person), you may
> not copy or deliver this message to anyone. In such case, you
> should destroy this message and notify the sender by reply email.
> Please advise immediately if you or your employer do not consent to
> Internet email for messages of this kind. Opinions, conclusions and
> other information in this message that do not relate to the
> official business of The Shaw Group Inc. or its subsidiaries shall
> be understood as neither given nor endorsed by it.
> __ The Shaw Group Inc.
> http://www.shawgrp.com
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

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


Re: [Rd] choose fails a fundamental property of binomial coefficients (PR#11035)

2008-03-26 Thread maechler
> "JL" == Jerry Lewis <[EMAIL PROTECTED]>
> on Wed, 26 Mar 2008 05:10:04 +0100 (CET) writes:

JL> Full_Name: Jerry W. Lewis Version: 2.7.0 (2008-03-23
JL> r44847) OS: Windows XP Professional Submission from:
JL> (NULL) (71.184.230.48)


JL> choose(n,k) = choose(n,n-k) is not satisfied if either

JL> 1. n is a negative integer with k a positive integer
JL> (due to automatically returning 0 for n-k<0)


JL> 2. n is not an integer with k a positive integer (due to
JL> rounding n-k to an integer, compounded by automatically
JL> returning 0 if n<0 which implies n-k<0)


I think you have not really understood from help(choose)
that we have

 choose(n,k) :=  n(n-1)...(n-k+1) / k!

defined for non-negative integer k and arbitrary real n

This definition has the very important property that it is used
in the 'binomial theorem' and everything depending on that
theorem,

   (1 + x) ^ \alpha =  \sum_{k=0}^\infty  choose(x,k) x^k

which holds   for all |x| < 1   for all \alpha \in \R

---

Your "fundamental" property does only hold when  n is
non-negative integer.

Definitely no bug in R here!

Martin Maechler, ETH Zurich

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


[Rd] as.POSIXct/as.POSIXlt generics

2008-03-26 Thread Sklyar, Oleg (MI London)
Hi,

I am trying to define the as.POSIXct as an S4 method for one of my
classes. Trying to define a generic, I am getting an error that it is
already differently defined in base. However, if I query for it, there
is no definition. Being in base, I also cannot really import it. If I
define methods without definig a generic, they will work but with a
warning that a new generic will be automatically created. See the code
chunk below. Any idea how to make it work w/o warnings?

All the same for as.POSIXlt.

Using S3 definition instead works for the parent class, but seems to
require an additional definition for derived ones, well, I'd rather
avoid S3.

Thanks, Oleg

Help page definition: 

> ?as.POSIXct
Usage:
as.POSIXct(x, tz = "")

osklyar:R > R
*** R version 2.6.2 (2008-02-08) ***
> getGeneric("as.POSIXct")
NULL

> setGeneric("as.POSIXct", function(x, tz)
standardGeneric("as.POSIXct"))
New generic for "as.POSIXct" does not agree with implicit generic from
package "base"; a new generic will be assigned with package ".GlobalEnv"
[1] "as.POSIXct"

osklyar:R > R
*** R version 2.6.2 (2008-02-08) ***
> source("TimeDate.R")
Creating a new generic function for "as.POSIXct" in ".GlobalEnv"
Creating a new generic function for "as.POSIXlt" in ".GlobalEnv"

The latter executes: setMethod("as.POSIXct", w/o setGeneric

> sessionInfo()
R version 2.6.2 (2008-02-08)
x86_64-unknown-linux-gnu

locale:
LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=C;LC_MO
NETARY=en_GB.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=
C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATI
ON=C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

Dr Oleg Sklyar
Technology Group
Man Investments Ltd
+44 (0)20 7144 3803
[EMAIL PROTECTED]


**
The contents of this email are for the named addressee(s) only.
It contains information which may be confidential and privileged.
If you are not the intended recipient, please notify the sender
immediately, destroy this email and any attachments and do not
otherwise disclose or use them. Email transmission is not a
secure method of communication and Man Investments cannot accept
responsibility for the completeness or accuracy of this email or
any attachments. Whilst Man Investments makes every effort to keep
its network free from viruses, it does not accept responsibility
for any computer virus which might be transferred by way of this
email or any attachments. This email does not constitute a request,
offer, recommendation or solicitation of any kind to buy, subscribe,
sell or redeem any investment instruments or to perform other such
transactions of any kind. Man Investments reserves the right to
monitor, record and retain all electronic communications through
its network to ensure the integrity of its systems, for record
keeping and regulatory purposes. 

Visit us at: www.maninvestments.com

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


Re: [Rd] Incorrect behavior in 64-bit version (PR#11034) (solved)

2008-03-26 Thread Lodewijk Bonebakker
Peter,

thank you for your reply, the provided link had the answer:

The problem is the Sun cc compiler not following the C99 syntax  
standard. Adding -xc99 to compiler flags fixed the problem.

My incorrect assumption was that configure.in would contain most of  
the recommended flags for compilation, combined with using the same  
wrapper script for compilation that has worked successfully since  
version 1.9. Obviously it is no longer current and I have added 'make  
check' as additional safety.

Thank you again,

Lodewijk Bonebakker


For general interest (since this is going to be public anyway), here  
is my wrapper script:

#!/bin/bash
## quick-buildR,64
##
## build R, libiconv and readline should be installed in /usr/sfw/lib/ 
amd64
##
export CC="cc -xc99"
export CPP=""
export CXX=CC
export FC=f95
export F77=f95
##
export BASEFLAGS="-m64 -I/usr/sfw/include"
# export FPICFLAGS="-Bdynamic -G"
# export CXXPICFLAGS="-pic"
# export SHLIB_CXXFLAGS="-Bdynamic -G"
# export MAIN_CFLAGS="-m64 -I/usr/sfw/include"
# export SHLIB_CFLAGS="-m64"
# export MAIN_FFLAGS="-m64"
# export SHLIB_FFLAGS="-m64"
##
export CFLAGS="${BASEFLAGS} -O -xO5 -xc99 -xlibmieee -xlibmil -nofstore"
export FFLAGS="${BASEFLAGS} -O5 -libmil -nofstore"
export CXXFLAGS="${BASEFLAGS} -O -xO5 -xlibmil -nofstore"
export FCFLAGS=${FFLAGS}
export SHLIB_CXXLDFLAGS="-G -lCstd"
export SAFE_FFLAGS="-O5 -libmil -fstore"
##
export LDFLAGS="-m64 -L/usr/sfw/lib/amd64  -L/usr/sfw/lib"

##
./configure --prefix=/opt/R/v2.6.2,64 --with-blas=sunperf --with-lapack

RESULT=$?
if [ $RESULT -eq 0 ]; then
 gmake
 RESULT=$?
fi
if [ $RESULT -eq 0 ]; then
 gmake check
RESULT=$?
fi
if [ $RESULT -eq 0 ]; then
 gmake install
 RESULT=$?
fi
echo "RESULT $RESULT"

## end of script



On Mar 25, 2008, at 15:09, Peter Dalgaard wrote:

> [EMAIL PROTECTED] wrote:
>> Full_Name: Lodewijk Bonebakker
>> Version: v2.6.2
>> OS: Solaris, x86, snv_80
>> Submission from: (NULL) (192.18.43.225)
>>
>>
>> when I build R in 32-bit mode on my 64-bit OS, R works as expected:
>>
>> R version 2.6.2 (2008-02-08)
>> ...
>> Type 'q()' to quit R.
>>
>>
>>> m <- matrix(ncol=2,c(1:6))
>>>
>>> m
>>>
>> [,1] [,2]
>> [1,]14
>> [2,]25
>> [3,]36
>>
>>> n <- log10(m)
>>> n
>>>
>>  [,1]  [,2]
>> [1,] 0.000 0.6020600
>> [2,] 0.3010300 0.6989700
>> [3,] 0.4771213 0.7781513
>>
>>
>> On a 64-bit build, uisng *only* the "-m64" to instruct the sun  
>> compilers to
>> generate a 64 bit binary, the following happens (there are no  
>> compilation
>> errors)
>>
>>
>> R version 2.6.2 (2008-02-08)
>> ...
>> Type 'q()' to quit R.
>>
>>
>>> m <- matrix(ncol=2,c(1:6))
>>> m
>>>
>> [,1] [,2]
>> [1,]14
>> [2,]25
>> [3,]36
>>
>>> n <- log10(m)
>>>
>> Warning message:
>> In log(1:6, 10) : NaNs produced
>>
>>> n
>>>
>>[,1] [,2]
>> [1,]   0.14289140
>> [2,]  -1.18344030
>> [3,] NaN0
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
> There is not sufficient information to go on here (with a sun.com  
> address you could be expected to know better). R works fine as a 64  
> bit program on several platforms, as far as I know including  
> Solaris, so the issue has to be specific to your compiler and  
> library setup.
>
> This has all the hallmarks of a math header file error (either args  
> or return value declared of the wrong type), or a linker issue (log  
> not really log). I surely hope it fails "make check"!
>
> So, exactly what did you do, which compiler and build tools and  
> which version?
> Did you read the http://cran.r-project.org/doc/manuals/R-admin.html,  
> including Appendix C?
> (Please keep R-bugs in the recipient list. I'm not the resident  
> expert.)
>
> -- 
>  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] choose fails a fundamental property of binomial coefficients (PR#11035)

2008-03-26 Thread Jerry . Lewis
Full_Name: Jerry W. Lewis
Version: 2.7.0 (2008-03-23 r44847)
OS: Windows XP Professional
Submission from: (NULL) (71.184.230.48)


choose(n,k) = choose(n,n-k) is not satisfied if either

1. n is a negative integer with k a positive integer (due to automatically
returning 0 for n-k<0)

2. n is not an integer with k a positive integer (due to rounding n-k to an
integer, compounded by automatically returning 0 if n<0 which implies n-k<0)

Both are easily fixed, as discussed in PR# 10766

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


[Rd] Misc/List Search Path from keyboard (PR#11036)

2008-03-26 Thread richardwreed
Full_Name: Richard Reed
Version: 2.6.2
OS: MS Windows XP Pro
Submission from: (NULL) (76.121.170.35)


Pressing Alt-M+s doesn't search path. It just generates another ">". It does
this in "vanilla" too. However, Alt-M+click "list search path" does work. Note
that when I press Alt-M (and the "Misc" menu drops down) the second "s" in "list
search way" is underlined indicating the "s" should complete the command.

> version
platform   i386-pc-mingw32 
arch   i386
os mingw32 
system i386, mingw32   
status 
major  2   
minor  6.2 
year   2008
month  02  
day08  
svn rev44383   
language   R   
version.string R version 2.6.2 (2008-02-08)

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


Re: [Rd] R 64 on Intel Mac check problem

2008-03-26 Thread Prof Brian Ripley
On Tue, 25 Mar 2008, Georgios Marentakis wrote:

> many thanks for the response.
> I tried compiling without optimization and it still gives me the same
> problem.
> Would you think it is something related to the package? Could it be that I
> should use another version  of the particular package than the one included?
> Or could it be something with the way the results are compared?
> Would you suggest I can trust this version of R for performing the
> statistical analysis I am after?

Note that your compiler is not the same as mine (from Xcode 3.0).  If it 
fails without optimization, I would not trust it. I don't know though 
which it is: http://cran.stat.sfu.ca/with is not a valid URL, and I don't 
know which instructions you followed (assuming they are somewhere on 
CRAN).

Simon Urbanek is making available quad-arch experimental builds of 
R-devel, and I suggest you try one of those.  (I haven't, but then I have 
other, reliable, 64-bit platforms and am only doing this to test changes 
to R.)

> many thanks,
> georgios
>
>
> On Tue, Mar 25, 2008 at 6:39 PM, Prof Brian Ripley <[EMAIL PROTECTED]>
> wrote:
>
>> I saw this yesterday, on my newly reinstalled iMac (10.5.2), with the
>> Xcode compiler + gfortran from R 2.6.2.
>>
>> It looks very like a compiler bug: if I insert a printf statement in
>> stem.c I get the correct answer, and if I compile src/appl/stem.c without
>> optimization I get the correct answer.
>>
>> So, I suggest lowering the optimization level, but the worry always is
>> that if you have one piece of code miscompiled there may be others.
>>
>> On Tue, 25 Mar 2008, Georgios Marentakis wrote:
>>
>>> Dear all, I have been following the instructions on
>>> http://cran.stat.sfu.ca/with the intention to install R with 64 bits
>>> support on an 8 core Intel Mac
>>> with 6 GB of memory. I am doing this so I can run an analysis that
>> requires
>>> 1.6 gB of memory allocation and would not run on 32 bit version of R as
>> I
>>> was advised and experienced.
>>> I have installed gcc 4.2 and gfortran 4.2 from the available sources on
>> the
>>> web page and am using the copy and paste guide on the page.
>>>
>>> Now everything seems to be going fine until the point where the R
>> packages
>>> are tested. In particular when the regression tests are run I get the
>>> following.
>>>
>>> running regression tests
>>> running code in 'reg-tests-1.R' ...\c
>>> OK
>>> running code in 'reg-tests-2.R' ...\c
>>> OK
>>> comparing 'reg-tests-2.Rout' to './reg-tests-2.Rout.save' ...\c
>>> 3756c3756
>>> <   The decimal point is 1 digit(s) to the right of the |
>>> ---
   The decimal point is at the |
>>> 3762c3762
>>> <   The decimal point is 1 digit(s) to the right of the |
>>> ---
   The decimal point is 1 digit(s) to the left of the |
>>> 3764c3764
>>> <   0 | 11
>>> ---
   1 | 00
>>> make[3]: *** [reg-tests-2.Rout] Error 1
>>> make[2]: *** [test-Reg] Error 2
>>> make[1]: *** [test-all-basics] Error 1
>>> make: *** [check] Error 2
>>>
>>> Would any of you be able to point me to what is the reason for this?
>>> thanks,
>>> georgios
>>>
>>>   [[alternative HTML version deleted]]
>>>
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>
>> --
>> 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
>>
>
>   [[alternative HTML version deleted]]
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
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