[Rd] qt for df < 1

2005-12-08 Thread roger koenker
I was experimenting yesterday with a binomial make.link option
for estimating student t binary response models, tentatively
called gossit, and I noticed eventually that the R qt function doesn't
like df < 1.  Vaguely recalling that Splus didn't seem to mind such
weirdness,  I checked on our soon to be defunct Splus6.2 and
sure enough, it produced plausible answers instead of R's NA's.
Of course, I have no way of judging the quality of these answers,
but I'm curious about whether someone has already looked into
this can of worms.


url:www.econ.uiuc.edu/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

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


Re: [Rd] qt for df < 1

2005-12-09 Thread roger koenker
On Dec 9, 2005, at 10:05 AM, Luke Tierney wrote:

> On Thu, 8 Dec 2005, Peter Dalgaard wrote:
>
>> roger koenker <[EMAIL PROTECTED]> writes:
>>
>>> I was experimenting yesterday with a binomial make.link option
>>> for estimating student t binary response models, tentatively
>>> called gossit, and I noticed eventually that the R qt function  
>>> doesn't
>>> like df < 1.  Vaguely recalling that Splus didn't seem to mind such
>>> weirdness,  I checked on our soon to be defunct Splus6.2 and
>>> sure enough, it produced plausible answers instead of R's NA's.
>>> Of course, I have no way of judging the quality of these answers,
>>> but I'm curious about whether someone has already looked into
>>> this can of worms.
>>
>> Well the help page has:
>>
>> For 'qt' only values of at least one are currently supported.
>>
>> and someone must have written that...
>>
>> R does have pt for df < 1, so a temporary fix using uniroot() seems
>> doable.
>>
>>
>
> Something like
>
> qqt<-function(p,df) sign(p-0.5)*sqrt(qf(1-2*pmin(p,1-p),1,df))
>
> seems to do reasonably, at least in terms of consistency with pt, down
> to 0.2 or mayby 0.1 df based on
>
> f<-function(d, n = 101) {
>   x<-seq(0, 1, len = n)
>   max(abs(pt(qqt(x, d), d) - x))
> }
> plot(function(d) log10(sapply(d, f)), .01,1)
>
> luke

Splus6.2 seems to be using just this approach based on similar testing.

Pure schadenfreude makes it hard to resist mentioning that in Splus6.2
qf(0, df1, df2)  gives -Inf  rather than 0, which caused some  
difficulties initially with my
attempt to replicate the comparison.

Roger


>
> -- 
> Luke Tierney
> Chair, Statistics and Actuarial Science
> Ralph E. Wareham Professor of Mathematical Sciences
> University of Iowa  Phone: 319-335-3386
> Department of Statistics andFax:   319-335-3017
>Actuarial Science
> 241 Schaeffer Hall  email:  [EMAIL PROTECTED]
> Iowa City, IA 52242 WWW:  http://www.stat.uiowa.edu

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


Re: [Rd] 'sessionInfo()' instead of 'version'

2005-12-29 Thread roger koenker

In a private response to Tony Plate's suggestion to replace version()
output with sessionInfo() in R-help requests,

> roger koenker wrote:
>> Thanks for this, it would seem useful to have version numbers for
>> the packages too?

and Tony replied,
>
> Sounds sensible to me!  If I were you I'd send a message to R-devel  
> suggesting this.  AFAIK, some changes to sessionInfo() are already  
> being considered, so this is a good time to suggest that.

So, for what it is worth

Roger

PS  My notion is that it is sometimes useful to document the state of  
play
when a particular object was created, much like the recent thread on
date stamping of objects in R-help.

url:    www.econ.uiuc.edu/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

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


Re: [Rd] 'sessionInfo()' instead of 'version'

2005-12-29 Thread roger koenker
My fault,  what you show is exactly what I wanted...

url:www.econ.uiuc.edu/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820


On Dec 29, 2005, at 3:09 PM, Duncan Murdoch wrote:

> On 12/29/2005 3:07 PM, roger koenker wrote:
>> In a private response to Tony Plate's suggestion to replace version()
>> output with sessionInfo() in R-help requests,
>>> roger koenker wrote:
>>>
>>>> Thanks for this, it would seem useful to have version numbers for
>>>> the packages too?
>> and Tony replied,
>>> Sounds sensible to me!  If I were you I'd send a message to R- 
>>> devel  suggesting this.  AFAIK, some changes to sessionInfo() are  
>>> already  being considered, so this is a good time to suggest that.
>> So, for what it is worth
>> Roger
>> PS  My notion is that it is sometimes useful to document the state  
>> of  play
>> when a particular object was created, much like the recent thread on
>> date stamping of objects in R-help.
>
> I'm not sure what you're asking for.  This is what I see in R- 
> patched; it's very similar to what 2.1.1 shows:
>
> > sessionInfo()
> R version 2.2.1, 2005-12-27, i386-pc-mingw32
>
> attached base packages:
> [1] "splines"   "methods"   "stats" "graphics"  "grDevices"  
> "utils"
> [7] "datasets"  "base"
>
> other attached packages:
> multtest survival
>  "1.8.0"   "2.20"
>
> There's no point showing the versions of base packages, because  
> they match the R version.  What other information would you like to  
> see?
>
> So far the following reasonable suggestions have been made.  I  
> forget where they were posted, so you may not have seen them:
>
>  - the Subversion revision number, at least for non-released versions
>  - the version number of the GUI, at least for OS X (where it  
> changes independently of R).
>
> Duncan Murdoch

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


[Rd] NAMESPACE imports

2015-06-22 Thread Roger Koenker
I need some advice on how to resolve a warning in a revision of my REBayes 
package.

At the moment the package Depends on SparseM and Matrix and does some mildly 
exotic
coercion like this:

A <- as(as.matrix.csc(A),"dgCMatrix")

that converts a SparseM csr matrix A into a SparseM csc matrix and then into a 
dgC Matrix. I suppose
that I could try to convert all of this sort of thing into pkg::fname calls, 
but I don�t relish the prospect.  Is
there some other strategy?  Actually, to be honest, I�m not entirely sure how 
to do this conversion for the
above expression, so if this is the way to go, could someone explain the right 
way to deal with the first as()?

At the moment I�m stuck with the following warning that I can�t seem to find a 
way around:


* checking whether package 'REBayes' can be installed ... WARNING
Found the following significant warnings:
  Warning: replacing previous import by 'SparseM::coerce' when loading �REBayes'



[[alternative HTML version deleted]]

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


[Rd] Packages required but not available:

2015-08-30 Thread Roger Koenker
I’m trying to get my empirical Bayes package, REBayes, back in compliance with 
CRAN.
However, I’m not sure what to do about the following from R CMD check —as-cran 
on
the current R-devel:

Strong dependencies not in mainstream repositories:
  pogs
* checking package namespace information ... OK
* checking package dependencies ... ERROR
Packages required but not available: 'Rmosek' 'reliaR' ‘pogs'

pogs is available here:  http://foges.github.io/pogs/ref/admm
Rmosek seems to be back on CRAN but perhaps not happily on osx
reliaR seems to be on CRAN

All three of these packages appear on the imports line of my DESCRIPTION file.
Could someone clue me in on what to do?
Thanks,
Roger


url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


Re: [Rd] CRAN packages maintained by you

2016-08-28 Thread Roger Koenker
Hi Kurt,

I have started to look into this, and I need some guidance about how to
prioritize my repairs.  There are basically 4 categories of warnings from
gfortran’s pedantic critique of my packages:

1.  Some errant tab characters it doesn’t like,
2.  Too many or too few continue statements
3.  Horrible (and obsolescent) arithmetic and computed gotos
4.  undeclared doubles and dubious conversions 

The last category seems relatively easy to fix and is potentially
important, but the others seem more difficult to fix and altogether
less important.  The goto issues are all in code that has been written
long ago by others and imported, e.g. Peyton and Ng’s cholesky.f.
I’m very reluctant to mess with any of those gotos.  The fact that
they were declared obsolete long ago doesn’t mean that gfortran 
has any intention of not supporting these constructs in the future,
does it?  

Before devoting more time and energy, which is in short supply
lately, I like to hear what others are thinking/doing about all this,
so I’ll copy this to r-devel.

All the best,
Roger

url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801


> On Aug 28, 2016, at 2:36 AM, Kurt Hornik  wrote:
> 
> 
> Dear maintainers,
> 
> This concerns the CRAN packages


> 
> Using gfortran with options -Wall -pedantic to compile your package
> Fortran code finds important problems, see your package check pages for
> more information.  
> 
> Can you please fix these problems as quickly as possible?
> 
> Best
> -k

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

[Rd] Namespaces and S4 Generics

2014-07-11 Thread Roger Koenker
I've installed R-devel

R Under development (unstable) (2014-07-09 r66111)
Platform: x86_64-apple-darwin13.1.0 (64-bit)

and am trying to resolve some problems that I am seeing with my 
SparseM package.  In prior versions I explicitly had:

setGeneric("image", function(x, ...) standardGeneric("image"))

and then used setMethod to define a method for the class matrix.csr
but my reading of the setGeneric manpage suggests that this call to
setGeneric need not, and probably should not have this second 
argument, and indeed, need not exist at all, since the generic is
automatically created by the setMethod invocation.

However,  what is puzzling to me is that in my new R-devel version
none of these options have the intended effect of making "image"
a generic and allowing R to dispatch for matrix.csr objects.  When
I omit the setGeneric() call, I do get a message at INSTALL time
that a generic for image is being created, but then after loading
SparseM:

> showMethods(image)
Function "image":


On the command line, I can make this work:

> setGeneric("image")
[1] "image"
> showMethods(image)
Function: image (package graphics)
x="ANY"
x="matrix.csr"

And -- even more irritating --  if I  require(Matrix)  then the generic
is created together with my method and all the Matrix methods.  At 
the risk of theorizing without data, I suspect that this has something
to do with NAMESPACES, and I have tried to follow the setup for
Matrix by having:

importFrom("graphics", image)
exportMethods("image")

but clearly I'm still missing some crucial aspect.  Any suggestions
would be most welcome.

Roger



url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


Re: [Rd] Namespaces and S4 Generics

2014-07-13 Thread Roger Koenker
John,

Thanks very much.  As you suggested, this turned out not to have anything to do 
with R-devel.  Instead, it seemed traceable
to my decision a while back to start require()'ing packages in my .Rprofile, at 
least when I removed .Rprofile then my original
code for image methods worked fine in the current version of R-devel.  "Ours 
not to reason why..."  

Roger

url:www.econ.uiuc.edu/~roger        Roger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

On Jul 11, 2014, at 8:35 PM, John Chambers  wrote:

> Roger,
> 
> Are you implying that your current code works differently under R-devel than 
> with the current release?  Nothing I'm aware of would suggest that.
> 
> With or without setGeneric() (in either version but the single-argument is 
> cleaner), a generic function for image() is created in your package's 
> namespace.
> 
> If you don't export that function, calls from other functions in your package 
> will still get the generic  version but calls from outside the package will 
> get graphics::image.
> 
> Here's an example.  In my PkgA I have:
> 
>   setGeneric("image")
> 
>   setMethod("image", "A", function(x, ...) message("dummy image for class 
> A"))
> 
>   showStuff <- function() showMethods("image")
> 
> In the NAMESPACE, I exported showStuff, but not image.
> 
> As a result:
> 
>> require(PkgA)
> Loading required package: PkgA
>> image
> function (x, ...) 
> UseMethod("image")
> 
> 
>> showMethods("image")
> 
> Function "image":
> 
>> showStuff
> function () 
> showMethods("image")
> 
>> showStuff()
> Function: image (package graphics)
> x="A"
> x="ANY"
> 
> The methods are visible to code inside PkgA but others see only the S3 
> function.
> 
> John
> 
> 
> On Jul 11, 2014, at 11:27 AM, Roger Koenker  wrote:
> 
>> I've installed R-devel
>> 
>> R Under development (unstable) (2014-07-09 r66111)
>> Platform: x86_64-apple-darwin13.1.0 (64-bit)
>> 
>> and am trying to resolve some problems that I am seeing with my 
>> SparseM package.  In prior versions I explicitly had:
>> 
>> setGeneric("image", function(x, ...) standardGeneric("image"))
>> 
>> and then used setMethod to define a method for the class matrix.csr
>> but my reading of the setGeneric manpage suggests that this call to
>> setGeneric need not, and probably should not have this second 
>> argument, and indeed, need not exist at all, since the generic is
>> automatically created by the setMethod invocation.
>> 
>> However,  what is puzzling to me is that in my new R-devel version
>> none of these options have the intended effect of making "image"
>> a generic and allowing R to dispatch for matrix.csr objects.  When
>> I omit the setGeneric() call, I do get a message at INSTALL time
>> that a generic for image is being created, but then after loading
>> SparseM:
>> 
>>> showMethods(image)
>> Function "image":
>> 
>> 
>> On the command line, I can make this work:
>> 
>>> setGeneric("image")
>> [1] "image"
>>> showMethods(image)
>> Function: image (package graphics)
>> x="ANY"
>> x="matrix.csr"
>> 
>> And -- even more irritating --  if I  require(Matrix)  then the generic
>> is created together with my method and all the Matrix methods.  At 
>> the risk of theorizing without data, I suspect that this has something
>> to do with NAMESPACES, and I have tried to follow the setup for
>> Matrix by having:
>> 
>> importFrom("graphics", image)
>> exportMethods("image")
>> 
>> but clearly I'm still missing some crucial aspect.  Any suggestions
>> would be most welcome.
>> 
>> Roger
>> 
>> 
>> 
>> url:www.econ.uiuc.edu/~rogerRoger Koenker
>> emailrkoen...@uiuc.eduDepartment of Economics
>> vox: 217-333-4558University of Illinois
>> fax:   217-244-6678Urbana, IL 61801
>> 
>> __
>> 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] [R-SIG-Mac] R-3.1.1 - R CMD INSTALL problem

2014-07-25 Thread Roger Koenker
FWIW when I installed R-devel  a week or so ago, I had to also install 
gfortran-4.8.2-darwin13.tar.bz2 from 

http://r.research.att.com/libs/

well "had to"  is perhaps too strong, but I was seeing complaints about not 
running 4.8 and they went away
after this install.

Roger

url:www.econ.uiuc.edu/~roger    Roger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

On Jul 25, 2014, at 8:14 AM, Simon Urbanek  wrote:

> Eduardo,
> 
> On Jul 24, 2014, at 8:37 PM, Eduardo M. A. M.Mendes  
> wrote:
> 
>> Hello
>> 
>> I have recently upgraded R to the newest version.  Unfortunately my old 
>> (fortran and C) R-package cannot be installed anymore (was built before R 
>> 3.0.0: please re-install it). 
>> 
>> I have tried R CMD INSTALL package_name but I noticed that 
>> R-3.1.1-binary-mac requests gcc-4.8.2 and specific locations for the 
>> libraries (gcc and gfortran).  
> 
> No, it doesn't. You must be using some other binary that the official CRAN 
> one (http://cran.r-project.org/bin/macosx )
> Our binaries only use standard Apple compilers (from Xcode - in recent OS X 
> versions you can use xcode-select --install on the command line to install) 
> plus a GNU Fortran that you can download from CRAN.
> 
> 
>> Can someone point me to the documentation on how to install  gcc as R 
>> requires, please?
>> 
>> Please note that I have used "brew install gcc" on another mac and soft 
>> linked all the necessary libraries so that gcc-4.9.1 can be used as 4.8 (as 
>> R requires). However I would like a clean installation.
>> 
> 
> I you use brew, then you're on your own and you should refer to their 
> support. Our builds do not require brew (or any other 3rd party build system).
> 
> Cheers,
> Simon
> 
> PS: Please note that R-SIG-Mac is the proper mailing list for Mac-specific 
> questions.
> 
> ___
> R-SIG-Mac mailing list
> r-sig-...@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

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


Re: [Rd] [R-SIG-Mac] R-3.1.1 - R CMD INSTALL problem

2014-07-25 Thread Roger Koenker
Yes,  Mavericks as I should have mentioned.  Anyway,  thanks for providing the 
4.8 version, this made it all very
convenient, and I always have more confidence when downloading R tools of 
yours, rather than exploring further
afield.

Roger

url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

On Jul 25, 2014, at 10:50 AM, Simon Urbanek  wrote:

> On Jul 25, 2014, at 11:25 AM, Roger Koenker  wrote:
> 
>> FWIW when I installed R-devel  a week or so ago, I had to also install 
>> gfortran-4.8.2-darwin13.tar.bz2 from 
>> 
>> http://r.research.att.com/libs/
>> 
>> well "had to"  is perhaps too strong, but I was seeing complaints about not 
>> running 4.8 and they went away
>> after this install.
>> 
> 
> Ah, I think you're talking about the Mavericks builds. That one is indeed 
> using GNU Fortran 4.8.2, but it should technically work even with the 4.2 
> CRAN Fortran. The only issue is that it uses the gfortran-4.8 name with 
> version, so apart from symlinking the versions the easiest way is to install 
> the binary above.
> 
> Thanks,
> Simon
> 
> 
>> Roger
>> 
>> url:www.econ.uiuc.edu/~rogerRoger Koenker
>> emailrkoen...@uiuc.eduDepartment of Economics
>> vox: 217-333-4558University of Illinois
>> fax:   217-244-6678Urbana, IL 61801
>> 
>> On Jul 25, 2014, at 8:14 AM, Simon Urbanek  
>> wrote:
>> 
>>> Eduardo,
>>> 
>>> On Jul 24, 2014, at 8:37 PM, Eduardo M. A. M.Mendes  
>>> wrote:
>>> 
>>>> Hello
>>>> 
>>>> I have recently upgraded R to the newest version.  Unfortunately my old 
>>>> (fortran and C) R-package cannot be installed anymore (was built before R 
>>>> 3.0.0: please re-install it). 
>>>> 
>>>> I have tried R CMD INSTALL package_name but I noticed that 
>>>> R-3.1.1-binary-mac requests gcc-4.8.2 and specific locations for the 
>>>> libraries (gcc and gfortran).  
>>> 
>>> No, it doesn't. You must be using some other binary that the official CRAN 
>>> one (http://cran.r-project.org/bin/macosx )
>>> Our binaries only use standard Apple compilers (from Xcode - in recent OS X 
>>> versions you can use xcode-select --install on the command line to install) 
>>> plus a GNU Fortran that you can download from CRAN.
>>> 
>>> 
>>>> Can someone point me to the documentation on how to install  gcc as R 
>>>> requires, please?
>>>> 
>>>> Please note that I have used "brew install gcc" on another mac and soft 
>>>> linked all the necessary libraries so that gcc-4.9.1 can be used as 4.8 
>>>> (as R requires). However I would like a clean installation.
>>>> 
>>> 
>>> I you use brew, then you're on your own and you should refer to their 
>>> support. Our builds do not require brew (or any other 3rd party build 
>>> system).
>>> 
>>> Cheers,
>>> Simon
>>> 
>>> PS: Please note that R-SIG-Mac is the proper mailing list for Mac-specific 
>>> questions.
>>> 
>>> ___
>>> R-SIG-Mac mailing list
>>> r-sig-...@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>> 

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


[Rd] vignette checking woes

2015-03-25 Thread Roger Koenker
I'm having trouble with R CMD check of my quantreg package.  All is well
until I get to:  

checking running R code from vignettes ...
   ‘rq.Rnw’ ... failed
 ERROR
Errors in running code in vignettes:
when running code in ‘rq.Rnw’

when I see a snippet from the vignette code and then:

Loading required namespace: MatrixModels

  When sourcing ‘rq.R’:
Error: could not find function "sparse.model.matrix"
Execution halted

This is baffling to me since sparse.model.matrix is in the
namespace of Matrix and it should be loaded at this stage
since it is required by MatrixModels which has just been
pronounced "loaded".

I've verified that I can Sweave("rq.Rnw")
and texi2pdf("rq.tex", clean=TRUE) without any problem.

Any hints greatly appreciated, as always.

Roger


url:    www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


Re: [Rd] vignette checking woes

2015-03-25 Thread Roger Koenker
Thierry,

I have this:

if (require(MatrixModels) && require(Matrix)) {
  X <- model.Matrix(Terms, m, contrasts, sparse = TRUE)

in my function rqss()  I've tried variants of requireNamespace too without 
success.
If I understand properly model.Matrix is from MatrixModels but it calls 
sparse.model.matrix which is part of Matrix, and it is the latter function that 
I'm
not finding.  Maybe I should go back to the requireNamespace strategy again?

Roger

url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

> On Mar 25, 2015, at 2:54 PM, Thierry Onkelinx  
> wrote:
> 
> Dear Roger,
> 
> How is Matrix loaded?
> 
> If you use sparse.model.matrix() inside a function from your package you need 
> to declare it as Matrix::sparse.model.matrix()
> 
> Best regards,
> 
> ir. Thierry Onkelinx
> Instituut voor natuur- en bosonderzoek / Research Institute for Nature and 
> Forest 
> team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance 
> Kliniekstraat 25
> 1070 Anderlecht
> Belgium
> 
> To call in the statistician after the experiment is done may be no more than 
> asking him to perform a post-mortem examination: he may be able to say what 
> the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner 
> The combination of some data and an aching desire for an answer does not 
> ensure that a reasonable answer can be extracted from a given body of data. ~ 
> John Tukey
> 
> 2015-03-25 19:59 GMT+01:00 Roger Koenker :
> I'm having trouble with R CMD check of my quantreg package.  All is well
> until I get to:
> 
> checking running R code from vignettes ...
>  ‘rq.Rnw’ ... failed
> ERROR
> Errors in running code in vignettes:
> when running code in ‘rq.Rnw’
> 
> when I see a snippet from the vignette code and then:
> 
> Loading required namespace: MatrixModels
> 
> When sourcing ‘rq.R’:
> Error: could not find function "sparse.model.matrix"
> Execution halted
> 
> This is baffling to me since sparse.model.matrix is in the
> namespace of Matrix and it should be loaded at this stage
> since it is required by MatrixModels which has just been
> pronounced "loaded".
> 
> I've verified that I can Sweave("rq.Rnw")
> and texi2pdf("rq.tex", clean=TRUE) without any problem.
> 
> Any hints greatly appreciated, as always.
> 
> Roger
> 
> 
> url:www.econ.uiuc.edu/~rogerRoger Koenker
> emailrkoen...@uiuc.eduDepartment of Economics
> vox: 217-333-4558University of Illinois
> fax:   217-244-6678Urbana, IL 61801
> 
> __
> 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] vignette checking woes

2015-03-26 Thread Roger Koenker

> On Mar 26, 2015, at 8:50 AM, Martyn Plummer  wrote:
> 
> On Wed, 2015-03-25 at 15:12 -0500, Roger Koenker wrote:
>> Thierry,
>> 
>> I have this:
>> 
>> if (require(MatrixModels) && require(Matrix)) {
>>   X <- model.Matrix(Terms, m, contrasts, sparse = TRUE)
> 
> You have this in the current release, which does not show this problem
> in the CRAN tests. This, and the fact that you can build the vignette
> manually, suggests that there is a problem with your checking
> environment.
> 
> Did you set up a special checking environment in ~/.R/check.Renviron ?
> Does it set R_LIBS?

No, not that I can find.  But I agree that there seems to be something fishy.  
Another
bit of evidence for this is fact that R CMD build gives me:

* creating vignettes ... ERROR
Rscript execution error: No such file or directory

so I've been building with the --no-build-vignettes flag...

Many thanks, for your suggestions,
Roger

> 
> Martyn
> 
>> in my function rqss()  I've tried variants of requireNamespace too without 
>> success.
>> If I understand properly model.Matrix is from MatrixModels but it calls 
>> sparse.model.matrix which is part of Matrix, and it is the latter function 
>> that I'm
>> not finding.  Maybe I should go back to the requireNamespace strategy again?
>> 
>> Roger
>> 
>> url:www.econ.uiuc.edu/~rogerRoger Koenker
>> emailrkoen...@uiuc.eduDepartment of Economics
>> vox: 217-333-4558University of Illinois
>> fax:   217-244-6678Urbana, IL 61801
>> 
>>> On Mar 25, 2015, at 2:54 PM, Thierry Onkelinx  
>>> wrote:
>>> 
>>> Dear Roger,
>>> 
>>> How is Matrix loaded?
>>> 
>>> If you use sparse.model.matrix() inside a function from your package you 
>>> need to declare it as Matrix::sparse.model.matrix()
>>> 
>>> Best regards,
>>> 
>>> ir. Thierry Onkelinx
>>> Instituut voor natuur- en bosonderzoek / Research Institute for Nature and 
>>> Forest 
>>> team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance 
>>> Kliniekstraat 25
>>> 1070 Anderlecht
>>> Belgium
>>> 
>>> To call in the statistician after the experiment is done may be no more 
>>> than asking him to perform a post-mortem examination: he may be able to say 
>>> what the experiment died of. ~ Sir Ronald Aylmer Fisher
>>> The plural of anecdote is not data. ~ Roger Brinner 
>>> The combination of some data and an aching desire for an answer does not 
>>> ensure that a reasonable answer can be extracted from a given body of data. 
>>> ~ John Tukey
>>> 
>>> 2015-03-25 19:59 GMT+01:00 Roger Koenker :
>>> I'm having trouble with R CMD check of my quantreg package.  All is well
>>> until I get to:
>>> 
>>> checking running R code from vignettes ...
>>> ‘rq.Rnw’ ... failed
>>> ERROR
>>> Errors in running code in vignettes:
>>> when running code in ‘rq.Rnw’
>>> 
>>> when I see a snippet from the vignette code and then:
>>> 
>>> Loading required namespace: MatrixModels
>>> 
>>> When sourcing ‘rq.R’:
>>> Error: could not find function "sparse.model.matrix"
>>> Execution halted
>>> 
>>> This is baffling to me since sparse.model.matrix is in the
>>> namespace of Matrix and it should be loaded at this stage
>>> since it is required by MatrixModels which has just been
>>> pronounced "loaded".
>>> 
>>> I've verified that I can Sweave("rq.Rnw")
>>> and texi2pdf("rq.tex", clean=TRUE) without any problem.
>>> 
>>> Any hints greatly appreciated, as always.
>>> 
>>> Roger
>>> 
>>> 
>>> url:www.econ.uiuc.edu/~rogerRoger Koenker
>>> emailrkoen...@uiuc.eduDepartment of Economics
>>> vox: 217-333-4558University of Illinois
>>> fax:   217-244-6678Urbana, IL 61801
>>> 
>>> __
>>> 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

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


[Rd] cyclic namespace dependency detected

2012-08-25 Thread Roger Koenker
I'm having trouble installing my quantreg package on 

R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

Seems odd since the CRAN version  seems to be fine, but I'm
seeing  after compiling of the i386 and x86-64 versions and 
installing the .so files:

….
installing to 
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/quantreg/libs/x86_64
** R
** data
** demo
** inst
** preparing package for lazy loading
Error in loadNamespace(package, c(which.lib.loc, lib.loc)) : 
  cyclic namespace dependency detected when loading 'quantreg', already loading 
'quantreg'
Error in .Fortran("srqfn", n = as.integer(n), m = as.integer(m), nnza = 
as.integer(nnza),  : 
  Fortran symbol name "srqfn" not in DLL for package "quantreg"
Error : unable to load R code in package 'quantreg'
ERROR: lazy loading failed for package 'quantreg'

Any suggestions would be much appreciated.

Roger

PS.  FWIW:  My NAMESPACE for the package looks like this:

useDynLib("quantreg")
import(SparseM)

# Export all names
exportPattern(".")


Roger Koenker
rkoen...@illinois.edu

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


[Rd] Mac v Windows Mystery

2013-01-30 Thread Roger Koenker
Dear All,

I'm trying to track down a problem with my quantreg package reported by a user 
doing censored quantile regression.
When he runs the test4.R file attached below (which reads the csv file also 
attached) on his windows machine he gets
an error like this:

> Error in dimnames(B) <- list(c("tau", dimnames(x)[[2]], "Qhat"), NULL) :
>   length of 'dimnames' [1] not equal to array extent
> In addition: Warning message:
> In rbind(grid[1:J], B, qhat) :
>   number of columns of result is not a multiple of vector length (arg 2)

However, when I run the same thing on my mac there is no error, no warning.  
And --
more strangely-- running this on another windows laptop here in Urbana also 
encounters
no problems.  I thought that this might just be a seed problem since there is a 
bootstrapping
step at the end, but the original user has tried several seeds and always gets 
this error.
We are all running 2.15.1 and V4.94 of quantreg.  I understand that YMMV, 
especially on
windows,  but it is difficult to debug this sort of thing when I can't 
reproduce it.  Any suggestions
or other experience would be welcome.  The test problem takes a minute or so to 
run on my
mac.

Thanks,
Roger


url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801


> 
> 
> 

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


Re: [Rd] Mac v Windows Mystery

2013-01-30 Thread Roger Koenker
Duncan,

Humm...  files must have been stripped from my original post  I've put them 
in http://www.econ.uiuc.edu/~roger/test/
but rerunning the example on my mac a third time revealed that my original "bad 
seed" hypothesis was vindicated,
So I now have something to work from.  Sorry for adding to the noise.

Roger

url:www.econ.uiuc.edu/~roger        Roger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

On Jan 30, 2013, at 11:47 AM, Duncan Murdoch wrote:

> On 13-01-30 11:37 AM, Roger Koenker wrote:
>> Dear All,
>> 
>> I'm trying to track down a problem with my quantreg package reported by a 
>> user doing censored quantile regression.
>> When he runs the test4.R file attached below (which reads the csv file also 
>> attached) on his windows machine he gets
>> an error like this:
>> 
>>> Error in dimnames(B) <- list(c("tau", dimnames(x)[[2]], "Qhat"), NULL) :
>>>   length of 'dimnames' [1] not equal to array extent
>>> In addition: Warning message:
>>> In rbind(grid[1:J], B, qhat) :
>>>   number of columns of result is not a multiple of vector length (arg 2)
>> 
>> However, when I run the same thing on my mac there is no error, no warning.  
>> And --
>> more strangely-- running this on another windows laptop here in Urbana also 
>> encounters
>> no problems.  I thought that this might just be a seed problem since there 
>> is a bootstrapping
>> step at the end, but the original user has tried several seeds and always 
>> gets this error.
>> We are all running 2.15.1 and V4.94 of quantreg.  I understand that YMMV, 
>> especially on
>> windows,  but it is difficult to debug this sort of thing when I can't 
>> reproduce it.  Any suggestions
>> or other experience would be welcome.  The test problem takes a minute or so 
>> to run on my
>> mac.
> 
> There was no attachment.  It might also be important to give more 
> detailed info, e.g. what sessionInfo() prints on the bad system, and 
> whether this is from Rgui or Rterm, and what ls() shows (in case some 
> function is being masked).
> 
> Duncan Murdoch
> 
> 
>> Thanks,
>> Roger
>> 
>> 
>> url:www.econ.uiuc.edu/~rogerRoger Koenker
>> emailrkoen...@uiuc.eduDepartment of Economics
>> vox: 217-333-4558University of Illinois
>> fax:   217-244-6678Urbana, IL 61801
>> 
>> 
>>> 
>>> 
>>> 
>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> __
>>>> 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


[Rd] GC encountered a node (…) with an unknown SEXP type

2013-02-20 Thread Roger Koenker
Dear All,

I'm trying to track down a very erratic bug in some fortran;  I have an example 
that
quite consistently segfaults on windoz, and more sporadically on mac, all in 
the 
course of doing some bootstrap calculations, varying the set.seed call,  but 
I'm now
trying to see what is going on on our  redhat system:

R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-linux-gnu (64-bit)

I now have an example, i.e. a seed, that produces the error:

Error in crq.fit.por(xb, yb, cb, weights = w, ctype = ctype, ...) : 
  GC encountered a node (0xb488bc0) with an unknown SEXP type: SPECIALSXP at 
memory.c:927

I've tried capturing the data for this call and running it from the terminal
window, but annoyingly it fails to complain when I do that.  I thought someone
might have a better idea.  My experience with gdb is very limited, I tried 
running
R -d gdb  
which reproduces the error, but this gets me back to the R prompt and I can't
see any more than what was available without gdb.  Any advice would be most
welcome.

Roger



url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


[Rd] Generic backsolve?

2009-07-07 Thread roger koenker

When loading the package SparseM, a "warning" is generated
indicating:

The following object(s) are masked from package:base :

One, of three, examples is the function backsolve which is defined
in SparseM as:

setGeneric("backsolve",
function(r, x, k = NULL, upper.tri = NULL, transpose = NULL,   
twice = TRUE, ...)

standardGeneric("backsolve"),
useAsDefault= function(r, x,  k = NULL, upper.tri = NULL,
transpose = NULL, twice = TRUE, ...)
base::backsolve(r, x, k = ncol(r), upper.tri = TRUE,
transpose = FALSE, ...))

Methods are then defined for sparse matrix classes.

My question is:  Is there a better way to do this that will avoid the
load warning?  Should I revert to the suggestion in the "Writing
R Extensions" manual and avoid the setGeneric approach
entirely?  (My most recent experience is with R 2.9.1, but this
has been an issue for several versions.)


url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


[Rd] evince pdf viewing

2009-10-30 Thread Roger Koenker
It was pointed out to me that scatter plots made on our rhel5 system  
(sessionInfo() below, have the curious
feature that when made with pdf() and viewed with evince show the  
points as "q" not "o".  Is this a known
problem with evince?  It is pretty clearly not a problem with R, since  
if I bring the pdf file back to my mac
and open in acrobat it looks normal.  So this is a just-in-case- 
someone-else-runs-into-this kind of post.


> sessionInfo()
R version 2.10.0 alpha (2009-10-09 r50012)
x86_64-unknown-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C  LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] survival_2.35-7 quantreg_4.42   SparseM_0.80

loaded via a namespace (and not attached):
[1] tools_2.10.0

url:www.econ.uiuc.edu/~roger    Roger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


[Rd] quoted strings in foo.Rd rendered as â

2009-10-30 Thread Roger Koenker

Another anomaly from our rhel5 system, again sessionInfo() below.
When I'm logged in remotely via ssh from my macpro and view  
documentation

files in my X11 window,  strings in single quotes in the files are all
abbreviated as â .   The same files appear fine when rendered in X11
using the local R,  and also appear fine in a terminal window on the
linux machine, so this could easily also be some sort of ssh/X11 issue
not R at all, but if someone had any suggestion for further checking
it would be greatly appreciated.

Roger

> sessionInfo()
R version 2.10.0 alpha (2009-10-09 r50012)
x86_64-unknown-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C  LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] survival_2.35-7 quantreg_4.42   SparseM_0.80

loaded via a namespace (and not attached):
[1] tools_2.10.0


url:www.econ.uiuc.edu/~roger    Roger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


Re: [Rd] evince pdf viewing

2009-10-31 Thread Roger Koenker

Thanks to all, the suggested fix has cleared this up.

Roger

On Oct 31, 2009, at 8:02 AM, Marc Schwartz wrote:

In the interest of full disclosure, I did not provide that  
particular workaround.


It came via a thread on r-help back in January:

 https://stat.ethz.ch/pipermail/r-help/2009-January/185742.html

and was then moved to r-devel:

 https://stat.ethz.ch/pipermail/r-devel/2009-January/051891.html

The workaround was posted by Martin in the r-devel part of the  
thread, which in turn was retrieved from the bug report here:


 http://bugs.freedesktop.org/show_bug.cgi?id=18002

See comments #8 and #10 in the above.


Thanks!

Marc Schwartz


On Oct 30, 2009, at 4:15 PM, Prof Brian Ripley wrote:

Yes, it is known: it is described with workarounds (thanks to Marc  
Schwarz, AFAIR) on the ?pdf help page.


On Fri, 30 Oct 2009, Roger Koenker wrote:

It was pointed out to me that scatter plots made on our rhel5  
system (sessionInfo() below, have the curious
feature that when made with pdf() and viewed with evince show the  
points as "q" not "o".  Is this a known
problem with evince?  It is pretty clearly not a problem with R,  
since if I bring the pdf file back to my mac
and open in acrobat it looks normal.  So this is a just-in-case- 
someone-else-runs-into-this kind of post.



sessionInfo()

R version 2.10.0 alpha (2009-10-09 r50012)
x86_64-unknown-linux-gnu

locale:
[1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C  LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8   LC_NAME=C
[9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

[8] base

other attached packages:
[1] survival_2.35-7 quantreg_4.42   SparseM_0.80

loaded via a namespace (and not attached):
[1] tools_2.10.0

url:www.econ.uiuc.edu/~roger    Roger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


--
Brian D. Ripley,  rip...@stats.ox.ac.uk
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


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


Re: [Rd] quoted strings in foo.Rd rendered as â

2009-10-31 Thread Roger Koenker


On Oct 30, 2009, at 4:11 PM, Prof Brian Ripley wrote:


First step to check: update to a released version of R 2.10.0!

I see the same behavior with:
R version 2.10.0 (2009-10-26)
x86_64-unknown-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C  LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

loaded via a namespace (and not attached):
[1] tools_2.10.0



If that does not help, using options(useFancyQuotes = TRUE) in the  
released version should (but possibly not as far back as your alpha  
pre-release).


And also with options(useFancyQuotes = TRUE)


I suspect that whatever you mean my 'my X11 window' (it is the  
application running in the window that matters, perhaps an xterm?)  
it is set to the wrong character set.  I simply use a Mac terminal  
window, and that ought to default to UTF-8 (but it can be changed,  
so check if you try one).
Yes,  I did mean xterm, and yes in a mac terminal window I do get  
correct rendering, so

maybe I should just give up on xterm entirely, but old habits die hard.


On Fri, 30 Oct 2009, Roger Koenker wrote:


Another anomaly from our rhel5 system, again sessionInfo() below.
When I'm logged in remotely via ssh from my macpro and view  
documentation
files in my X11 window,  strings in single quotes in the files are  
all

abbreviated as â .   The same files appear fine when rendered in X11
using the local R,  and also appear fine in a terminal window on the
linux machine, so this could easily also be some sort of ssh/X11  
issue

not R at all, but if someone had any suggestion for further checking
it would be greatly appreciated.

Roger


sessionInfo()

R version 2.10.0 alpha (2009-10-09 r50012)
x86_64-unknown-linux-gnu

locale:
[1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C  LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8   LC_NAME=C
[9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

[8] base

other attached packages:
[1] survival_2.35-7 quantreg_4.42   SparseM_0.80

loaded via a namespace (and not attached):
[1] tools_2.10.0


url:www.econ.uiuc.edu/~roger        Roger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


--
Brian D. Ripley,  rip...@stats.ox.ac.uk
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] quoted strings in foo.Rd rendered as â

2009-10-31 Thread Roger Koenker

Thanks again, options(useFancyQuotes = FALSE)  works perfectly!

Roger

On Oct 31, 2009, at 12:05 PM, Prof Brian Ripley wrote:


On Sat, 31 Oct 2009, Roger Koenker wrote:



On Oct 30, 2009, at 4:11 PM, Prof Brian Ripley wrote:


First step to check: update to a released version of R 2.10.0!

I see the same behavior with:
R version 2.10.0 (2009-10-26)
x86_64-unknown-linux-gnu

locale:
[1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C  LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8   LC_NAME=C
[9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

loaded via a namespace (and not attached):
[1] tools_2.10.0

If that does not help, using options(useFancyQuotes = TRUE) in the  
released version should (but possibly not as far back as your  
alpha pre-release).


And also with options(useFancyQuotes = TRUE)


Oops, you want FALSE to suppress it: TRUE is the default.

I suspect that whatever you mean my 'my X11 window' (it is the  
application running in the window that matters, perhaps an xterm?)  
it is set to the wrong character set.  I simply use a Mac terminal  
window, and that ought to default to UTF-8 (but it can be changed,  
so check if you try one).
Yes,  I did mean xterm, and yes in a mac terminal window I do get  
correct rendering, so
maybe I should just give up on xterm entirely, but old habits die  
hard.

On Fri, 30 Oct 2009, Roger Koenker wrote:

Another anomaly from our rhel5 system, again sessionInfo() below.
When I'm logged in remotely via ssh from my macpro and view  
documentation
files in my X11 window,  strings in single quotes in the files  
are all
abbreviated as â .   The same files appear fine when rendered in  
X11
using the local R,  and also appear fine in a terminal window on  
the
linux machine, so this could easily also be some sort of ssh/X11  
issue
not R at all, but if someone had any suggestion for further  
checking

it would be greatly appreciated.
Roger

sessionInfo()

R version 2.10.0 alpha (2009-10-09 r50012)
x86_64-unknown-linux-gnu
locale:
[1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C  LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8   LC_NAME=C
[9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] splines   stats graphics  grDevices utils datasets   
methods

[8] base
other attached packages:
[1] survival_2.35-7 quantreg_4.42   SparseM_0.80
loaded via a namespace (and not attached):
[1] tools_2.10.0
url:www.econ.uiuc.edu/~roger        Roger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

--
Brian D. Ripley,  rip...@stats.ox.ac.uk
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




--
Brian D. Ripley,  rip...@stats.ox.ac.uk
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] s4 generic issue

2009-11-04 Thread Roger Koenker

I'm hoping that someone with deeper insight into S4 than I,
that is to say virtually everyone reading this list, could help
resolve the following problem in SparseM.  We have

setGeneric("backsolve",
function(r, x, k = NULL, upper.tri = NULL, transpose = NULL,   
twice = TRUE, ...)

standardGeneric("backsolve"),
useAsDefault= function(r, x,  k = ncol(r), upper.tri = TRUE,
transpose = FALSE, twice = TRUE, ...)
base::backsolve(r, x, k = ncol(r), upper.tri = TRUE,
transpose = FALSE, ...))

and then proceed to use setMethod for a class matrix.csr.chol.   
However, this seems

to cause problems in the following instance:  if one does the following

require(lars)
require(SparseM)
example(lars)
[snip]
lars> object3 <- lars(x,y,type="for") # Can use abbreviations
Error in base::backsolve(r, x, k = ncol(r), upper.tri = TRUE,  
transpose = FALSE,  :

  NA/NaN/Inf in foreign function call (arg 4)
> traceback()
10: .C("bakslv", t = r, ldt = nrow(r), n = k, b = x, ldb = k, nb = nb,
x = matrix(0, k, nb), job = job, info = integer(1L), DUP =  
FALSE,

PACKAGE = "base")
9: base::backsolve(r, x, k = ncol(r), upper.tri = TRUE, transpose =  
FALSE,

   ...)
8: backsolve(R, backsolvet(R, Sign[positive]))
7: backsolve(R, backsolvet(R, Sign[positive]))
6: nnls.lars(active, Sign, R, directions, Gram[active, active],
   trace = trace, use.Gram = TRUE, eps = eps)
5: lars(x, y, type = "for")
4: eval.with.vis(expr, envir, enclos)
3: eval.with.vis(ei, envir)
2: source(zfile, local, echo = echo, prompt.echo = paste(prompt.prefix,
   getOption("prompt"), sep = ""), continue.echo = paste 
(prompt.prefix,
   getOption("continue"), sep = ""), verbose = verbose,  
max.deparse.length = Inf,

   encoding = encoding, skip.echo = skips, keep.source = TRUE)
1: example(lars)

So clearly base::backsolve is getting called as would be desired in  
this case,

but something is rotten in the way arguments are being passed.

I'm aware that the R-extensions manual suggests another strategy than
setGeneric for making generics, but I would like to understand what is  
going

wrong here.

Roger


url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Urbana, IL 61801

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


[Rd] no visible binding

2007-10-12 Thread roger koenker
Could someone advise me about how to react to the message:

* checking R code for possible problems ... NOTE
slm: no visible binding for global variable 'response'

from R CMD check SparseMwith
* using R version 2.6.0 Under development (unstable) (2007-09-03 r42749)

The offending code looks like this:

"slm" <-
function (formula,  data, weights, na.action, method = "csr",
 contrasts = NULL, ...)
{
 call <- match.call()
 m <- match.call(expand.dots = FALSE)
 m$method <- m$model <- m$x <- m$y <- m$contrasts <-  m$... <- NULL
 m[[1]] <- as.name("model.frame")
 m <- eval(m, sys.frame(sys.parent()))
 if (method == "model.frame")
 return(m)
 Terms <- attr(m, "terms")
 weights <- model.extract(m, weights)
 Y <- model.extract(m, response)
 X <- as.matrix.csr(model.matrix(Terms, m, contrasts))
 fit <- {
 if (length(weights))
 slm.wfit(X, Y,  weights, method, ...)
 else slm.fit(X, Y,  method, ...)
 }
 fit$terms <- Terms
 fit$call <- call
 attr(fit, "na.message") <- attr(m, "na.message")
 class(fit) <- c(if (is.matrix(Y)) "mslm", "slm")
 fit
}


url:www.econ.uiuc.edu/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

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


[Rd] faqs

2007-11-14 Thread roger koenker
An extremely modest proposal:

It would be nice if packages could have a FAQ and if

faq(package.name)

would produce this faq.  And if, by default

faq()
FAQ()

would produce the admirable R faq...  Apologies in advance
if there is already a mechanism like this, but help.search()
didn't reveal anything.

url:www.econ.uiuc.edu/~roger    Roger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820

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


[Rd] reordering combn(n,p)

2008-02-14 Thread roger koenker
I found the following slightly surprising and thought that it might
(eventually) be useful to someone to document it:

Problem:  I wanted to reorder the columns of the matrix produced
by combn(n,p) so that adjacent columns only differed by one  element.

I assumed that this was a problem known to the Assyrians and
resisted the temptation to write to r-help, and through assiduous
googling finally discovered that this was still a topic of current
research in computer science.

Solution:   Limin Xiang and Kazuo Ushijima (2001) "On O(1) Time  
Algorithms for
Combinatorial Generation," Computer Journal, 44(4), 292-302.
provides a nice algorithm (in Pascal) which I then translated into
ratfor and plan to incorporate eventually into quantreg.  It manages
to do n=500 p = 3 in about 3 secs on my old G5.  It probably
isn't of interest to do problems too much bigger than this since
we are already at 20 x 10^6 columns.

url:www.econ.uiuc.edu/~roger        Roger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

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


[Rd] print.logLik

2008-02-23 Thread roger koenker
I have a vector of logLik values that I'd like to return and it would  
be nice
if the the print method didn't run them together.  Could I make a plea  
for
using sep = " ", rather than sep = "" in print.logLik?

url:www.econ.uiuc.edu/~rogerRoger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820

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


Re: [Rd] print.logLik

2008-02-23 Thread roger koenker
Commas would be fine especially if there were  spaces too,
as in your example.  I was just trying to suggest something
mimimalist ;-)

Cheers,
Roger

On Feb 23, 2008, at 11:21 AM, Martin Maechler wrote:

>>>>>> "rk" == roger koenker <[EMAIL PROTECTED]>
>>>>>>on Sat, 23 Feb 2008 10:34:41 -0600 writes:
>
>rk> I have a vector of logLik values that I'd like to return and  
> it would
>rk> be nice
>rk> if the the print method didn't run them together.  Could I  
> make a plea
>rk> for
>rk> using sep = " ", rather than sep = "" in print.logLik?
>
> well, "yes" to the plea to make the method ameanable to better
> printing of *several* values,
> but "no" to just changing sep there:
> We'd want to implement a change which is compatible
> for the usual cases of having only one value
> and your propsal would change all those outputs as well.
>
> Wouldn't you even prefer to see something like
>
>'log.Lik' 12.3, 7.89, 34.2  (df = 3)
>
> i.e., with "," between the values?
>
> Regards,
> Martin

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


[Rd] p-values from a resampled reference distribution

2008-10-01 Thread roger koenker

I'm implementing a new testing procedure proposed by Chen, Ying, Zhang
and Zhao (Biometrika, 2008) that employs a reference distribution  
obtained
by a resampling method.  For the moment I'm using logspline to  
estimate the
reference density and then computing the p-value using plogspline.  I  
would

be interested in hearing  about other suggestions from anyone who has
looked at similar situations.


url:www.econ.uiuc.edu/~roger    Roger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

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


[Rd] data argument and environments

2009-04-11 Thread roger koenker
I'm having difficulty with an environmental issue:  I have an additive  
model fitting function

with a typical call that looks like this:

require(quantreg)
n <- 100
x <- runif(n,0,10)
y <- sin(x) + rnorm(n)/5
d <- data.frame(x,y)
lam <- 2

f <- rqss(y ~ qss(x, lambda = lam), data = d)

this is fine when invoked as is; x and y are found in d, and lam is  
found the .GlobalEnv,
or at least this is how I understand it.  Now,  I'd like to have a  
function say,


h <- function(lam)
AIC(rqss(y ~ qss(x, lambda = lam), data = d))

but now,  if I do:

rm(lam)
h(1)
Error in qss1(x, constraint = constraint, lambda = lambda, dummies =  
dummies,  :

  object "lam" not found

worse, if there is a "lam"  in the .GlobalEnv it is used instead of  
the argument specified to h().
If I remove the data=d argument in the function definition then lam is  
passed correctly.
presumably because data defaults to parent.env().   I recognize that  
this is probably an elementary confusion on my part, but my  
understanding of environments is very limited.

I did read  the entry for FAQ 7.12,  but I'm still unenlightened.

url:    www.econ.uiuc.edu/~rogerRoger Koenker
email   rkoen...@uiuc.edu   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820

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


Re: [Rd] data argument and environments

2009-04-12 Thread roger koenker
Thanks.  Yes,  I wrote rqss,  and attempted to follow the structure of  
lm, and various analogues,
for example in survival4.  My problem seems to be that my lam variable  
is not part of
the data frame d, and I don't know how to manipulate the environment  
for the formula

so that it is found.  There is an untangle.specials() call

tmpc <- untangle.specials(Terms, "qss")

and then each of the "specials"  terms are evaluated in:

qss <- lapply(tmpc$vars, function(u) eval(parse(text = u), data))

which is fine if the data hasn't been specified so it defaults to  
parent.frame(), since in
this case variables and lam can all be found in the parent.frame,  but  
if
it is specified as a data frame for the variables of the model, then  
the lam value is
unavailable.  My impression is that it is somewhat unusual to pass  
data other than
variables from the data frame itself for evaluation of the formula --  
I thought there
were examples in mgcv, but I now see that  lamdas in gam() are passed  
as separate
arguments, rather than in the special components of the formula.   
Perhaps I need
to revert to this strategy, but I'd prefer not to.  Surely, there is  
some good way to modify
the above lapply so  that eval finds both stuff in data and in the  
parent.frame?  It
appears that I can simply define pf <- parent.frame()  and then add  
enclos = pf

to the above eval() call,  is this ok?

Roger

On Apr 11, 2009, at 6:43 PM, Duncan Murdoch wrote:


On 11/04/2009 6:50 PM, roger koenker wrote:
I'm having difficulty with an environmental issue:  I have an  
additive  model fitting function

with a typical call that looks like this:
require(quantreg)
n <- 100
x <- runif(n,0,10)
y <- sin(x) + rnorm(n)/5
d <- data.frame(x,y)
lam <- 2
f <- rqss(y ~ qss(x, lambda = lam), data = d)
this is fine when invoked as is; x and y are found in d, and lam  
is  found the .GlobalEnv,
or at least this is how I understand it.  Now,  I'd like to have a   
function say,

h <- function(lam)
AIC(rqss(y ~ qss(x, lambda = lam), data = d))
but now,  if I do:
rm(lam)
h(1)
Error in qss1(x, constraint = constraint, lambda = lambda, dummies  
=  dummies,  :

  object "lam" not found
worse, if there is a "lam"  in the .GlobalEnv it is used instead  
of  the argument specified to h().
If I remove the data=d argument in the function definition then lam  
is  passed correctly.
presumably because data defaults to parent.env().   I recognize  
that  this is probably an elementary confusion on my part, but my   
understanding of environments is very limited.

I did read  the entry for FAQ 7.12,  but I'm still unenlightened.


Formulas have environments attached to them, and modelling functions  
should look there if they don't find the object in the data  
argument. If your h is defined exactly as you wrote it, then the  
environment of the y ~ qss(...) formula will automatically be the  
evaluation frame of h, so it should be able to find lam.


You wrote rqss, right?  So perhaps you aren't evaluating the  
variables in the formula in the right place.  Do you use model.frame  
to do it? (See lm() for an example:  it takes the original call to  
lm, throws away all but a few arguments, and turns it into a call to  
model.frame() to find the necessary variables.)  model.frame() knows  
about environments and stuff, but assumes linear model-like data.


Duncan Murdoch


url:www.econ.uiuc.edu/~rogerRoger Koenker
email   rkoen...@uiuc.edu   Department of  
Economics
vox:217-333-4558University of  
Illinois

fax:217-244-6678Champaign, IL 61820
__
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] data argument and environments

2009-04-12 Thread roger koenker
Great, thanks again, Duncan.  And to Peter.  I've adopted the enclos =  
environment(formula)

solution.

Roger

On Apr 12, 2009, at 2:29 PM, Duncan Murdoch wrote:


roger koenker wrote:
Thanks.  Yes,  I wrote rqss,  and attempted to follow the structure  
of  lm, and various analogues,
for example in survival4.  My problem seems to be that my lam  
variable  is not part of
the data frame d, and I don't know how to manipulate the  
environment  for the formula

so that it is found.  There is an untangle.specials() call

tmpc <- untangle.specials(Terms, "qss")

and then each of the "specials"  terms are evaluated in:

qss <- lapply(tmpc$vars, function(u) eval(parse(text = u), data))



I think the fix here is to specify both the envir and enclos args to  
eval.  That is, do something like


eval(parse(text=u, envir=data, enclos=environment(formula)))

This says to look first in the dataframe, and then treat the  
environment of the formula as the parent environment.  By default,  
eval treats the calling frame as the parent.  In an lapply call,  
that's probably local variables in lapply(), which is not what you  
want.
which is fine if the data hasn't been specified so it defaults to   
parent.frame(), since in
this case variables and lam can all be found in the parent.frame,   
but  if
it is specified as a data frame for the variables of the model,  
then  the lam value is
unavailable.  My impression is that it is somewhat unusual to pass   
data other than
variables from the data frame itself for evaluation of the formula  
--  I thought there
were examples in mgcv, but I now see that  lamdas in gam() are  
passed  as separate
arguments, rather than in the special components of the formula.
Perhaps I need
to revert to this strategy, but I'd prefer not to.  Surely, there  
is  some good way to modify
the above lapply so  that eval finds both stuff in data and in the   
parent.frame?  It
appears that I can simply define pf <- parent.frame()  and then  
add  enclos = pf

to the above eval() call,  is this ok?



That might work, but some day a user might produce the formula  
somewhere else, and pass it in (e.g. if they write a wrapper  
function for rqss):  using environment(formula) should guarantee you  
pick up the right one.


Duncan Murdoch


Roger

On Apr 11, 2009, at 6:43 PM, Duncan Murdoch wrote:



On 11/04/2009 6:50 PM, roger koenker wrote:

I'm having difficulty with an environmental issue:  I have an   
additive  model fitting function

with a typical call that looks like this:
require(quantreg)
n <- 100
x <- runif(n,0,10)
y <- sin(x) + rnorm(n)/5
d <- data.frame(x,y)
lam <- 2
f <- rqss(y ~ qss(x, lambda = lam), data = d)
this is fine when invoked as is; x and y are found in d, and lam   
is  found the .GlobalEnv,
or at least this is how I understand it.  Now,  I'd like to have  
a   function say,

h <- function(lam)
AIC(rqss(y ~ qss(x, lambda = lam), data = d))
but now,  if I do:
rm(lam)
h(1)
Error in qss1(x, constraint = constraint, lambda = lambda,  
dummies  =  dummies,  :

 object "lam" not found
worse, if there is a "lam"  in the .GlobalEnv it is used instead   
of  the argument specified to h().
If I remove the data=d argument in the function definition then  
lam  is  passed correctly.
presumably because data defaults to parent.env().   I recognize   
that  this is probably an elementary confusion on my part, but  
my   understanding of environments is very limited.

I did read  the entry for FAQ 7.12,  but I'm still unenlightened.

Formulas have environments attached to them, and modelling  
functions  should look there if they don't find the object in the  
data  argument. If your h is defined exactly as you wrote it, then  
the  environment of the y ~ qss(...) formula will automatically be  
the  evaluation frame of h, so it should be able to find lam.


You wrote rqss, right?  So perhaps you aren't evaluating the   
variables in the formula in the right place.  Do you use  
model.frame  to do it? (See lm() for an example:  it takes the  
original call to  lm, throws away all but a few arguments, and  
turns it into a call to  model.frame() to find the necessary  
variables.)  model.frame() knows  about environments and stuff,  
but assumes linear model-like data.


Duncan Murdoch



url:www.econ.uiuc.edu/~rogerRoger Koenker
email   rkoen...@uiuc.edu   Department of   
Economics
vox:217-333-4558University of   
Illinois

fax:217-244-6678Champaign, IL 61820
__
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] Matrix / SparseM conflict (PR#8618)

2006-02-20 Thread roger koenker
On Feb 20, 2006, at 8:29 AM, Prof Brian Ripley wrote:

> On Mon, 20 Feb 2006, Duncan Murdoch wrote:
>
>> On 2/20/2006 8:54 AM, [EMAIL PROTECTED] wrote:
>>> Full_Name: David Pleydell
>>> Version: 2.2.1
>>> OS: Debian Etch
>>> Submission from: (NULL) (193.55.70.206)
>>>
>>>
>>> There appears to be a conflict between the chol functions from  
>>> the Matrix and
>>> the SparseM packages. chol() can only be applied to a matrix of  
>>> class dspMatrix
>>> if SparseM is not in the path.
>>
>> This isn't a bug, it's simply that both Matrix and SparseM define a
>> generic for chol (though Matrix actually gets it by converting the
>> function in base).
>
> The problem appears to be that SparseM first redefines chol as an  
> S3 generic and then defines S4 methods on it.  As no new S3 methods  
> are then defined the S3 step would seem unnecessary, but it is used  
> to allow the package to define S4 methods on a different signature  
> from R's chol().
> (That seems to me to be asking for trouble.)
>
> Only the package maintainer of SparseM can do anything about this.

I'm happy to modify this, but would welcome advice.  The current  
snafu is a consequence of writing a first
version of SparseM with S3 methods and then converting (evidently  
incompletely) to S4.
>
> Beyond, that I guess it is a consequence of namespaces that Matrix  
> defines methods via a derived generic on base::chol and not on the  
> generic chol in SparseM.  That needs further thought by someone  
> (JMC?) who understands the S4 internals.
>
>> If you want access to the version in Matrix after attaching SparseM
>> ahead of it in the search path, use Matrix::chol.
>
> But the whole point of generic functions is to allow one to write  
> generic code.
>
> -- 
> 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] Bug/Wishlist: 'partial' in 'sort' and 'quantile' (PR#8650)

2006-03-05 Thread roger koenker
I used to have a version of the classical Floyd and Revest "Select"  
algorithm (ACM#489)
for computing  univariate quantiles in my quantreg package.  At some  
point
g77 decided that it shouldn't be possible to use recursion  in  
fortran and I had
to remove it.  Stimulated by my your recent inquiry,  I thought I  
would see
whether it could be revived.  At least on my macs, running gfortran,  
it seems
that recursion is now again permissible.  I've not done any serious  
testing, but
I get:

 > unix.time(kuantile(y))  #my fortran translation of the Floyd- 
Revest algol algorithm
[1] 0.56 0.41 0.96 0.00 0.00
 > unix.time(median(y))
[1] 1.80 0.27 2.07 0.00 0.00
 > length(y)
[1] 1000

for a rnorm example.  I'd be happy to provide some new version of  
this, but
I'm afraid that there are still lots of g77 users, including on macs,  
that
wouldn't be functional due to the recursion.  Any thoughts on this  
would  be
appreciated.  Brian is doubtless right that current methods are  
perfectly
adequate for almost all purposes, but in cases of very large datasets  
where
many quantiles are needed, it may be worthwhile.

Roger

url:www.econ.uiuc.edu/~rogerRoger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820

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


[Rd] Quicker quantiles?

2006-03-11 Thread roger koenker
Motivated by Deepayan's recent inquiries about the efficiency of the  
R 'quantile'
function:

 http://tolstoy.newcastle.edu.au/R/devel/05/11/3305.html
 http://tolstoy.newcastle.edu.au/R/devel/06/03/4358.html

I decided to try to revive an old project to implement a version of  
the Floyd
and Rivest (1975) algorithm for finding quantiles with O(n)  
comparisons.  I
used to have a direct translation from FR's algol68 in my quantreg  
package,
but was forced to remove it when it encountered  g77 compilers that
didn't like the way I had handled recursion.

Fortunately, in the interim, I've corresponded with Krzysztof Kiwiel  
in Warsaw
who has made a detailed study of the algorithm:

K.C. Kiwiel: On Floyd and Rivest's SELECT Algorithm, Theoretical
   Computer Sci. 347 (2005) 214-238.

He has also kindly  agreed to allow me to incorporate his  
implementation of
the FR algorithm in R under GPL.

For the moment, I have made an alpha-test package with a single  
function --
'kuantile' -- that attempts to reproduce the functionality of the  
current
base quantile function, essentially replacing the partial sorting done
there with calls to Kiwiel's 'select' function.  This package is  
available
from:

 http://www.econ.uiuc.edu/~roger/research/rq/kuantile

The good news is that the new function  _is_ somewhat quicker than
the base 'quantile' function.  The following table is based on means
of 10 replications.  The first two columns report times for computing
just the median, the next two columns for computing the five default
quantiles:  seq(0,1,.25), and the last column is the time needed for  
a call
of sort().

 mean system.time()[1] for various calls*

   median only  default 5
n  quantile kuantile quantile kuantile  sort

1000.0020.0010.0040.004   0.000
1000  0.0020.0010.0030.002   0.002
10.0030.0020.0090.005   0.005
1e+050.0240.0100.0610.013   0.031
1e+060.2060.1200.5350.142   0.502
1e+072.1320.7905.5751.035   7.484

* On a mac G5 running R 2.2.1.

The bad news is that this approach doesn't help with Deepayan's
original question which involved instances in which quantile() was
being called for rather large number of probabilities.  In such
cases it seems that it is difficult to improve upon doing a full sort.

I would welcome comments on any of this

url:www.econ.uiuc.edu/~rogerRoger Koenker
email:  [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820

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


[Rd] Fwd: makeconf issue on R-devel 2006-03-12 r37524

2006-03-14 Thread roger koenker
I sent the message below to r-sig-mac yesterday, but having no reply
I decided to explore a bit myself and found that editing:

/Library/Frameworks/R.framework/Versions/2.3/Resources/share/make/ 
shlib.mk

yzzy: diff shlib.mk shlib.mk~
3c3
< include $(R_HOME)/etc/Makeconf
---
 > include $(R_HOME)/etc${R_ARCH}/Makeconf

restored the functionality of R CMD INSTALL.

Is this a known issue?


url:www.econ.uiuc.edu/~roger    Roger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820


Begin forwarded message:

> From: roger koenker <[EMAIL PROTECTED]>
> Date: March 13, 2006 4:46:30 PM CST
> To: r-sig-mac@stat.math.ethz.ch
> Subject: makeconf issue on R-devel 2006-03-12 r37524
>
> I've just installed R-devel   Version 2.3.0 Under development  
> (unstable) (2006-03-12 r37524)
> on a G5 and things went smoothly despite my gfortran configuration,  
> (that is ./configure, make,
> make install was fine), but now trying to install  a source package  
> I get:
>
> yzzy: R CMD check kuantile
> * checking for working latex ... OK
> * using log directory '/Users/roger/Projects/kuantile/kuantile.Rcheck'
> * using Version 2.3.0 Under development (unstable) (2006-03-12 r37524)
> * checking for file 'kuantile/DESCRIPTION' ... OK
> * this is package 'kuantile' version '1.00'
> * checking package dependencies ... OK
> * checking if this is a source package ... WARNING
> Subdirectory 'kuantile/src' contains object files.
> * checking whether package 'kuantile' can be installed ... ERROR
> Installation failed.
> See '/Users/roger/Projects/kuantile/kuantile.Rcheck/00install.out'  
> for details.
>
> yzzy: more /Users/roger/Projects/kuantile/kuantile.Rcheck/ 
> 00install.out
> * Installing *source* package 'kuantile' ...
> ** libs
> ** arch - Frameworks
> /Library/Frameworks/R.framework/Resources/share/make/shlib.mk:3: / 
> Library/Frameworks/R.fra
> mework/Resources/etc/Frameworks/Makeconf: No such file or directory
> make: *** No rule to make target `/Library/Frameworks/R.framework/ 
> Resources/etc/Frameworks
> /Makeconf'.  Stop.
> chmod: /Users/roger/Projects/kuantile/kuantile.Rcheck/kuantile/libs/ 
> Frameworks/*: No such
> file or directory
> gfortran   -fPIC -fno-common  -g -O2 -c dsel05.f -o dsel05.o
> gfortran   -fPIC -fno-common  -g -O2 -c kuantile.f -o kuantile.o
> gcc -flat_namespace -bundle -undefined suppress -L/sw/lib -L/usr/ 
> local/lib -o kuantile.so
> dsel05.o kuantile.o  -L/usr/local/lib/gcc/powerpc-apple- 
> darwin8/4.0.0 -L/usr/local/lib/gcc
> -lgfortran -lgcc_s -lSystemStubs -lmx -lSystem -F/Library/ 
> Frameworks/R.framework/.. -fram
> ework R
> ERROR: compilation failed for package 'kuantile'
> ** Removing '/Users/roger/Projects/kuantile/kuantile.Rcheck/kuantile'
>
> isn't there something fishy with the specification of the Makeconf  
> file in /etc/Frameworks???
>
> Roger
>
>
> url:www.econ.uiuc.edu/~rogerRoger Koenker
> email[EMAIL PROTECTED]Department of Economics
> vox: 217-333-4558University of Illinois
> fax:   217-244-6678Champaign, IL 61820
>
>

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


Re: [Rd] Fwd: makeconf issue on R-devel 2006-03-12 r37524

2006-04-08 Thread roger koenker
For what it is worth, I've just installed R-alpha Version 2.3.0 alpha  
(2006-04-07 r37668)
on my G5 and encountered the same problem reported below.  The same  
treatment
got  things going again.  If this reflects some idiosyncrasy in my  
setup,  my apologies


url:www.econ.uiuc.edu/~roger    Roger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820


On Mar 14, 2006, at 1:31 PM, Prof Brian Ripley wrote:

> On Tue, 14 Mar 2006, roger koenker wrote:
>
>> I sent the message below to r-sig-mac yesterday, but having no reply
>> I decided to explore a bit myself and found that editing:
>>
>> /Library/Frameworks/R.framework/Versions/2.3/Resources/share/make/
>> shlib.mk
>>
>> yzzy: diff shlib.mk shlib.mk~
>> 3c3
>> < include $(R_HOME)/etc/Makeconf
>> ---
>> > include $(R_HOME)/etc${R_ARCH}/Makeconf
>>
>> restored the functionality of R CMD INSTALL.
>>
>> Is this a known issue?
>
> No, and the change will break things which currently work correctly.
>
> Looks like this is something specific to how Macs install under the  
> bin/exec directory.  It likely stems from the following line in  
> INSTALL.
>
>  archs=`(cd ${R_HOME}/bin/exec; ls)`
>
> which on other systems will only contain directories for sub- 
> architectures or the R or Rgnome executables, since it says
>
>>> ** arch - Frameworks
>
>
>>
>> url:www.econ.uiuc.edu/~rogerRoger Koenker
>> email[EMAIL PROTECTED]Department of Economics
>> vox: 217-333-4558University of Illinois
>> fax:   217-244-6678Champaign, IL 61820
>>
>>
>> Begin forwarded message:
>>
>>> From: roger koenker <[EMAIL PROTECTED]>
>>> Date: March 13, 2006 4:46:30 PM CST
>>> To: r-sig-mac@stat.math.ethz.ch
>>> Subject: makeconf issue on R-devel 2006-03-12 r37524
>>>
>>> I've just installed R-devel   Version 2.3.0 Under development
>>> (unstable) (2006-03-12 r37524)
>>> on a G5 and things went smoothly despite my gfortran configuration,
>>> (that is ./configure, make,
>>> make install was fine), but now trying to install  a source package
>>> I get:
>>>
>>> yzzy: R CMD check kuantile
>>> * checking for working latex ... OK
>>> * using log directory '/Users/roger/Projects/kuantile/ 
>>> kuantile.Rcheck'
>>> * using Version 2.3.0 Under development (unstable) (2006-03-12  
>>> r37524)
>>> * checking for file 'kuantile/DESCRIPTION' ... OK
>>> * this is package 'kuantile' version '1.00'
>>> * checking package dependencies ... OK
>>> * checking if this is a source package ... WARNING
>>> Subdirectory 'kuantile/src' contains object files.
>>> * checking whether package 'kuantile' can be installed ... ERROR
>>> Installation failed.
>>> See '/Users/roger/Projects/kuantile/kuantile.Rcheck/00install.out'
>>> for details.
>>>
>>> yzzy: more /Users/roger/Projects/kuantile/kuantile.Rcheck/
>>> 00install.out
>>> * Installing *source* package 'kuantile' ...
>>> ** libs
>>> ** arch - Frameworks
>>> /Library/Frameworks/R.framework/Resources/share/make/shlib.mk:3: /
>>> Library/Frameworks/R.fra
>>> mework/Resources/etc/Frameworks/Makeconf: No such file or directory
>>> make: *** No rule to make target `/Library/Frameworks/R.framework/
>>> Resources/etc/Frameworks
>>> /Makeconf'.  Stop.
>>> chmod: /Users/roger/Projects/kuantile/kuantile.Rcheck/kuantile/libs/
>>> Frameworks/*: No such
>>> file or directory
>>> gfortran   -fPIC -fno-common  -g -O2 -c dsel05.f -o dsel05.o
>>> gfortran   -fPIC -fno-common  -g -O2 -c kuantile.f -o kuantile.o
>>> gcc -flat_namespace -bundle -undefined suppress -L/sw/lib -L/usr/
>>> local/lib -o kuantile.so
>>> dsel05.o kuantile.o  -L/usr/local/lib/gcc/powerpc-apple-
>>> darwin8/4.0.0 -L/usr/local/lib/gcc
>>> -lgfortran -lgcc_s -lSystemStubs -lmx -lSystem -F/Library/
>>> Frameworks/R.framework/.. -fram
>>> ework R
>>> ERROR: compilation failed for package 'kuantile'
>>> ** Removing '/Users/roger/Projects/kuantile/kuantile.Rcheck/ 
>>> kuantile'
>>>
>>> isn't there so

[Rd] Suggestions to speed up median() and has.na()

2006-04-11 Thread roger koenker
I've recently folded a new version of the Floyd-Rivest quantile  
algorithm
for quantiles into my quantreg package.  So it is easily available for
comparative testing.  On my G5 running last friday's  R-devel, I get:


  Median Only  5 Quantiles
  n  quantile kuantile quantile kuantile qsort
100 0.0030.003 0.0060.004 0.002
1000   0.0020.002 0.0020.002 0.002
1 0.0050.003 0.0080.003 0.001
1e+05 0.0220.010 0.0350.012 0.017
1e+06 0.1810.117 0.3080.138 0.200
1e+07 1.8530.762 3.1801.003 2.287


# Small timing experiment to compare kuantile and quantile

require(quantreg)
set.seed(1446)

ns <- 10^(2:7)
R <- 10
T <- array(NA,c(R,length(ns),5))
eps <- 20 * .Machine$double.eps
for(j in 1:length(ns)){
 for(i in 1:R){
 y <- rnorm(ns[j])
 T[i,j,1] <- system.time(qy <- quantile(y,.5))[1]
 T[i,j,2] <- system.time(ky <- kuantile(y,.5))[1]
 stopifnot(abs(qy - ky) < eps)
 T[i,j,3] <- system.time(qy <- quantile(y))[1]
 T[i,j,4] <- system.time(ky <- kuantile(y))[1]
 stopifnot(abs(qy - ky) < eps)
 T[i,j,5] <- system.time(sort(y,method="quick"))[1]
 }
 }

Tab <- apply(T,2:3,mean)
dimnames(Tab) <- list(paste(ns),c(rep(c("quantile","kuantile"), 
2),"qsort"))

url:www.econ.uiuc.edu/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

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


[Rd] Parametric links for glm?

2006-07-30 Thread roger koenker
At useR 2006 I mentioned that it would be nice to have a way to  
specify binomial links
that involved free parameters  and described some experience with a  
Gosset link involving
a free degrees of freedom parameter, and a Tukey-lambda link with two  
free parameters.
My implementation of this involved some rather kludgey modifications  
of binomial,
make.link and glm that (essentially) added a "..." argument to  
binomial permitting the
parameters to be passed down to the fitting routines.  So, in the  
Gosset case, for example,
had the following passage in  make.link, involving a free degrees of  
freedom parameter nu:

}, Gosset = {
 linkfun <- function(mu) qt(mu,nu)
 linkinv <- function(eta) {
 thresh <- -qqt(.Machine$double.eps,nu)
 eta <- pmin(thresh, pmax(eta, -thresh))
 pt(eta,nu)
 }
 mu.eta <- function(eta) pmax(dt(eta,nu), .Machine$double.eps)
 valideta <- function(eta) TRUE
},

Just prior to the useR meeting, there were some changes in R-devel to  
binomial that allow one to pass an object of class "link-glm" -- if I  
understand properly, this allows one to more easily
roll one's own links, but it leaves the question of passing  
parameters on the table.  That is,
presumably, I could pass a structure, like that above of class "link- 
glm" and thereby avoid
the Cerberus of  officially sanctioned links, but I still don't see  
how to pass my parameters.
Can someone enlighten me?  Or,  would it still be necessary to add  
"..." to the binomial
function?

url:www.econ.uiuc.edu/~rogerRoger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820

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


Re: [Rd] Parametric links for glm?

2006-07-30 Thread roger koenker
Thanks, that works splendidly.

url:www.econ.uiuc.edu/~rogerRoger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820


On Jul 30, 2006, at 11:11 AM, Prof Brian Ripley wrote:

> There is no reason to add ...: you could have
> binomial(link = Gosset(nu=5)).
>
> I really don't like the idea of changing system functions like  
> make.link,
> and believe it is not necessary.
>
> On Sun, 30 Jul 2006, roger koenker wrote:
>
>> At useR 2006 I mentioned that it would be nice to have a way to
>> specify binomial links
>> that involved free parameters  and described some experience with a
>> Gosset link involving
>> a free degrees of freedom parameter, and a Tukey-lambda link with two
>> free parameters.
>> My implementation of this involved some rather kludgey modifications
>> of binomial,
>> make.link and glm that (essentially) added a "..." argument to
>> binomial permitting the
>> parameters to be passed down to the fitting routines.  So, in the
>> Gosset case, for example,
>> had the following passage in  make.link, involving a free degrees of
>> freedom parameter nu:
>>
>> }, Gosset = {
>>  linkfun <- function(mu) qt(mu,nu)
>>  linkinv <- function(eta) {
>>  thresh <- -qqt(.Machine$double.eps,nu)
>>  eta <- pmin(thresh, pmax(eta, -thresh))
>>  pt(eta,nu)
>>  }
>>  mu.eta <- function(eta) pmax(dt(eta,nu), .Machine 
>> $double.eps)
>>  valideta <- function(eta) TRUE
>> },
>>
>> Just prior to the useR meeting, there were some changes in R-devel to
>
> Actually, it was a redesign of all the link functions to make them
> consistent: quasi was odd here.
>
>> binomial that allow one to pass an object of class "link-glm" -- if I
>> understand properly, this allows one to more easily
>> roll one's own links, but it leaves the question of passing
>> parameters on the table.  That is,
>> presumably, I could pass a structure, like that above of class "link-
>> glm" and thereby avoid
>> the Cerberus of  officially sanctioned links, but I still don't see
>> how to pass my parameters.
>> Can someone enlighten me?  Or,  would it still be necessary to add
>> "..." to the binomial
>> function?
>>
>> url:www.econ.uiuc.edu/~rogerRoger Koenker
>> email   [EMAIL PROTECTED]   Department of  
>> Economics
>> vox:217-333-4558University of  
>> Illinois
>> fax:217-244-6678Champaign, IL 61820
>>
>> __
>> 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


[Rd] configure on mac

2006-08-12 Thread roger koenker
I'm having trouble making yesterday's R-devel on my macs.

./configure seems fine, but eventually in make I get:

gcc -dynamiclib -Wl,-macosx_version_min -Wl,10.3 -undefined  
dynamic_lookup -single_module -multiply_defined suppress -L/sw/lib -L/ 
usr/local/lib -install_name libR.dylib -compatibility_version 2.4.0  - 
current_version 2.4.0  -headerpad_max_install_names -o libR.dylib  
Rembedded.o CConverters.o CommandLineArgs.o Rdynload.o Renviron.o  
RNG.o apply.o arithmetic.o apse.o array.o attrib.o base.o bind.o  
builtin.o character.o coerce.o colors.o complex.o connections.o  
context.o cov.o cum.o dcf.o datetime.o debug.o deparse.o deriv.o  
dotcode.o dounzip.o dstruct.o duplicate.o engine.o envir.o errors.o  
eval.o format.o fourier.o gevents.o gram.o gram-ex.o graphics.o  
identical.o internet.o iosupport.o lapack.o list.o localecharset.o  
logic.o main.o mapply.o match.o memory.o model.o names.o objects.o  
optim.o optimize.o options.o par.o paste.o pcre.o platform.o plot.o  
plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o  
qsort.o random.o regex.o registration.o relop.o rlocale.o saveload.o  
scan.o seq.o serialize.o size.o sort.o source.o split.o sprintf.o  
startup.o subassign.o subscript.o subset.o summary.o sysutils.o  
unique.o util.o version.o vfonts.o xxxpr.o   `ls ../appl/*.o ../nmath/ 
*.o ../unix/*.o  2>/dev/null|grep -v /ext-` -framework vecLib - 
lgfortran -lgcc_s -lSystemStubs -lmx -lSystem  ../extra/zlib/ 
libz.a ../extra/bzip2/libbz2.a ../extra/pcre/libpcre.a  -lintl - 
liconv -Wl,-framework -Wl,CoreFoundation -lreadline  -lm -liconv
/usr/bin/libtool: unknown option character `m' in: -macosx_version_min
Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile 
[,dirname]] [-arch_only arch] [-sacLT]
Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile 
[,dirname]] [-arch_only arch] [-o output] [-install_name name] [- 
compatibility_version #] [-current_version #] [-seg1addr 0x#] [- 
segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table  
] [-seg_addr_table_filename ] [-all_load]  
[-noall_load]
make[3]: *** [libR.dylib] Error 1
make[2]: *** [R] Error 2
make[1]: *** [R] Error 1
make: *** [R] Error 1

This was ok  as of my last build which was:

 > version
_
platform   powerpc-apple-darwin8.7.0
arch   powerpc
os darwin8.7.0
system powerpc, darwin8.7.0
status Under development (unstable)
major  2
minor  4.0
year   2006
month  07
day28
svn rev38710
language   R
version.string R version 2.4.0 Under development (unstable)  
(2006-07-28 r38710)

url:www.econ.uiuc.edu/~roger    Roger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820

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


Re: [Rd] configure on mac

2006-08-14 Thread roger koenker
Yes,  upgrading to Xcode 2.4  worked perfectly.  Thanks to all.

url:www.econ.uiuc.edu/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820


On Aug 14, 2006, at 8:07 AM, stefano iacus wrote:

> Hi Roger,
> due to latest change in the build scripts, you need to get the  
> latest apple dev tools to correctly build r-devel. In particular,  
> libtool needs to be updated. This is contained in the latest apple  
> dev (XCode 2.3 as other mentioned) on apple developer web site.
> stefano
>
> On 12/ago/06, at 18:56, roger koenker wrote:
>
>> I'm having trouble making yesterday's R-devel on my macs.
>>
>> ./configure seems fine, but eventually in make I get:
>>
>> gcc -dynamiclib -Wl,-macosx_version_min -Wl,10.3 -undefined
>> dynamic_lookup -single_module -multiply_defined suppress -L/sw/lib  
>> -L/
>> usr/local/lib -install_name libR.dylib -compatibility_version  
>> 2.4.0  -
>> current_version 2.4.0  -headerpad_max_install_names -o libR.dylib
>> Rembedded.o CConverters.o CommandLineArgs.o Rdynload.o Renviron.o
>> RNG.o apply.o arithmetic.o apse.o array.o attrib.o base.o bind.o
>> builtin.o character.o coerce.o colors.o complex.o connections.o
>> context.o cov.o cum.o dcf.o datetime.o debug.o deparse.o deriv.o
>> dotcode.o dounzip.o dstruct.o duplicate.o engine.o envir.o errors.o
>> eval.o format.o fourier.o gevents.o gram.o gram-ex.o graphics.o
>> identical.o internet.o iosupport.o lapack.o list.o localecharset.o
>> logic.o main.o mapply.o match.o memory.o model.o names.o objects.o
>> optim.o optimize.o options.o par.o paste.o pcre.o platform.o plot.o
>> plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o
>> qsort.o random.o regex.o registration.o relop.o rlocale.o saveload.o
>> scan.o seq.o serialize.o size.o sort.o source.o split.o sprintf.o
>> startup.o subassign.o subscript.o subset.o summary.o sysutils.o
>> unique.o util.o version.o vfonts.o xxxpr.o   `ls ../appl/*.o ../ 
>> nmath/
>> *.o ../unix/*.o  2>/dev/null|grep -v /ext-` -framework vecLib -
>> lgfortran -lgcc_s -lSystemStubs -lmx -lSystem  ../extra/zlib/
>> libz.a ../extra/bzip2/libbz2.a ../extra/pcre/libpcre.a  -lintl -
>> liconv -Wl,-framework -Wl,CoreFoundation -lreadline  -lm -liconv
>> /usr/bin/libtool: unknown option character `m' in: - 
>> macosx_version_min
>> Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile
>> [,dirname]] [-arch_only arch] [-sacLT]
>> Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile
>> [,dirname]] [-arch_only arch] [-o output] [-install_name name] [-
>> compatibility_version #] [-current_version #] [-seg1addr 0x#] [-
>> segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table
>> ] [-seg_addr_table_filename ] [-all_load]
>> [-noall_load]
>> make[3]: *** [libR.dylib] Error 1
>> make[2]: *** [R] Error 2
>> make[1]: *** [R] Error 1
>> make: *** [R] Error 1
>>
>> This was ok  as of my last build which was:
>>
>>> version
>> _
>> platform   powerpc-apple-darwin8.7.0
>> arch   powerpc
>> os darwin8.7.0
>> system powerpc, darwin8.7.0
>> status Under development (unstable)
>> major  2
>> minor  4.0
>> year   2006
>> month  07
>> day28
>> svn rev38710
>> language   R
>> version.string R version 2.4.0 Under development (unstable)
>> (2006-07-28 r38710)
>>
>> url:www.econ.uiuc.edu/~rogerRoger Koenker
>> email   [EMAIL PROTECTED]   Department of  
>> Economics
>> vox:217-333-4558University of  
>> Illinois
>> fax:217-244-6678Champaign, IL 61820
>>
>> __
>> 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] configure on mac

2006-08-14 Thread roger koenker
My prior message now seems a bit premature.  R seemed fine and, for
example, installed my package SparseM without complaint, but  now
trying to install  quantreg or Matrix, I'm getting:

gcc -dynamiclib -Wl,-macosx_version_min -Wl,10.3 -undefined  
dynamic_lookup -single_module -multiply_defined suppress -L/sw/lib -L/ 
usr/local/lib -o quantreg.so akj.o boot.o bound.o boundc.o chlfct.o  
cholesky.o dsel05.o extract.o kuantile.o mcmb.o penalty.o qrcens.o  
rls.o rq1.o rqbr.o rqfn.o rqfnb.o rqfnc.o sparskit2.o srqfn.o  
srqfnc.o srtpai.o xlapack.o -L/Library/Frameworks/R.framework/ 
Resources/lib -lRblas -L/usr/local/lib/gcc/powerpc-apple- 
darwin8/4.0.0 -L/usr/local/lib/gcc -lgfortran -lgcc_s -lSystemStubs - 
lmx -lSystem -F/Library/Frameworks/R.framework/.. -framework R
ld: multiple definitions of symbol __gfortran_filename
/Library/Frameworks/R.framework/Resources/lib/libRblas.dylib(single  
module) definition of __gfortran_filename
/usr/local/lib/libgfortran.a(error.o) definition of  
__gfortran_filename in section (__DATA,__data)
ld: multiple definitions of symbol __gfortran_line
/Library/Frameworks/R.framework/Resources/lib/libRblas.dylib(single  
module) definition of __gfortran_line
.
.
.
/usr/bin/libtool: internal link edit command failed
make: *** [quantreg.so] Error 1
ERROR: compilation failed for package 'quantreg'

Any further suggestions would be very welcome.

Roger

url:www.econ.uiuc.edu/~roger        Roger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820


On Aug 14, 2006, at 8:15 AM, roger koenker wrote:

> Yes,  upgrading to Xcode 2.4  worked perfectly.  Thanks to all.
>
> url:www.econ.uiuc.edu/~roger    Roger Koenker
> email[EMAIL PROTECTED]Department of Economics
> vox: 217-333-4558University of Illinois
> fax:   217-244-6678Champaign, IL 61820
>
>
> On Aug 14, 2006, at 8:07 AM, stefano iacus wrote:
>
>> Hi Roger,
>> due to latest change in the build scripts, you need to get the  
>> latest apple dev tools to correctly build r-devel. In particular,  
>> libtool needs to be updated. This is contained in the latest apple  
>> dev (XCode 2.3 as other mentioned) on apple developer web site.
>> stefano
>>
>> On 12/ago/06, at 18:56, roger koenker wrote:
>>
>>> I'm having trouble making yesterday's R-devel on my macs.
>>>
>>> ./configure seems fine, but eventually in make I get:
>>>
>>> gcc -dynamiclib -Wl,-macosx_version_min -Wl,10.3 -undefined
>>> dynamic_lookup -single_module -multiply_defined suppress -L/sw/ 
>>> lib -L/
>>> usr/local/lib -install_name libR.dylib -compatibility_version  
>>> 2.4.0  -
>>> current_version 2.4.0  -headerpad_max_install_names -o libR.dylib
>>> Rembedded.o CConverters.o CommandLineArgs.o Rdynload.o Renviron.o
>>> RNG.o apply.o arithmetic.o apse.o array.o attrib.o base.o bind.o
>>> builtin.o character.o coerce.o colors.o complex.o connections.o
>>> context.o cov.o cum.o dcf.o datetime.o debug.o deparse.o deriv.o
>>> dotcode.o dounzip.o dstruct.o duplicate.o engine.o envir.o errors.o
>>> eval.o format.o fourier.o gevents.o gram.o gram-ex.o graphics.o
>>> identical.o internet.o iosupport.o lapack.o list.o localecharset.o
>>> logic.o main.o mapply.o match.o memory.o model.o names.o objects.o
>>> optim.o optimize.o options.o par.o paste.o pcre.o platform.o plot.o
>>> plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o
>>> qsort.o random.o regex.o registration.o relop.o rlocale.o saveload.o
>>> scan.o seq.o serialize.o size.o sort.o source.o split.o sprintf.o
>>> startup.o subassign.o subscript.o subset.o summary.o sysutils.o
>>> unique.o util.o version.o vfonts.o xxxpr.o   `ls ../appl/*.o ../ 
>>> nmath/
>>> *.o ../unix/*.o  2>/dev/null|grep -v /ext-` -framework vecLib -
>>> lgfortran -lgcc_s -lSystemStubs -lmx -lSystem  ../extra/zlib/
>>> libz.a ../extra/bzip2/libbz2.a ../extra/pcre/libpcre.a  -lintl -
>>> liconv -Wl,-framework -Wl,CoreFoundation -lreadline  -lm -liconv
>>> /usr/bin/libtool: unknown option character `m' in: - 
>>> macosx_version_min
>>> Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile
>>> [,dirname]] [-arch_only arch] [-sacLT]
>>> Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile
>>> [,dirname]] [-arch_only arch] [-o output] [-install_name name] [-
>>> compatibility_version #] [-current_version #] [-seg1addr 0x#] [-
>>> segs_read_only_addr 0x

Re: [Rd] configure on mac

2006-08-15 Thread roger koenker
Apologies for my ignorance about these matters.

I think that the multiply defined symbols were probably my fault.  After
removing some lapack routines and using a
modified version of Makevars  suggested by Martin Maechler

## we use the BLAS and now also the LAPACK library:
PKG_LIBS= $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

The multiple definitions problems don't appear, but instead I get  --  
trying to INSTALL
quantreg  --  the same problem with undefined _xerbla_ appears when I  
try to install
Matrix.  A variety of other source packages install without complaint.

gcc -dynamiclib -Wl,-macosx_version_min -Wl,10.3 -undefined  
dynamic_lookup -single_module
-multiply_defined suppress -L/sw/lib -L/usr/local/lib -o quantreg.so  
akj.o boot.o chlfct.o
cholesky.o dsel05.o extract.o kuantile.o mcmb.o penalty.o qrcens.o  
rls.o rq1.o rqbr.o rqf
n.o rqfnb.o rqfnc.o sparskit2.o srqfn.o srqfnc.o srtpai.o -L/Library/ 
Frameworks/R.framewor
k/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/ 
lib -lRblas -L/usr/l
ocal/lib/gcc/powerpc-apple-darwin8/4.0.0 -L/usr/local/lib/gcc - 
lgfortran -lgcc_s -lSystemS
tubs -lmx -lSystem -L/usr/local/lib/gcc/powerpc-apple-darwin8/4.0.0 - 
L/usr/local/lib/gcc -
lgfortran -lgcc_s -lSystemStubs -lmx -lSystem -F/Library/Frameworks/ 
R.framework/.. -framew
ork R
ld: warning can't open dynamic library: libR.dylib referenced from: / 
Library/Frameworks/R.
framework/Resources/lib/libRlapack.dylib (checking for undefined  
symbols may be affected)
(No such file or directory, errno = 2)
ld: Undefined symbols:
_xerbla_ referenced from libRlapack expected to be defined in libR.dylib
/usr/bin/libtool: internal link edit command failed

_xerbla_  is in

yzzy: otool -Tv libR.dylib | grep xerbla
single module_xerbla_

which doesn't appear to be part of the ld above should it be?   
Can this be arranged
by modifying Makevars?


url:www.econ.uiuc.edu/~roger        Roger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

On Aug 15, 2006, at 1:08 AM, Prof Brian Ripley wrote:

> On Tue, 15 Aug 2006, stefano iacus wrote:
>
>> It seems that there are symbols defined in more than one header. This
>> causes problems on mac. You should define the symbol in one header
>> and declare elsewhere as extern. You can find examples in main.c (if
>> I remember well).
>> I'm not sure this is the problems, but it looks like
>
> One of the reasons given by Simon for this change was that was no  
> longer
> a problem: see the last sentence of
>
> o   MacOS X 10.3 and higher now use two-level namespaces, single
> module in a shared library and allow undefined symbols to be
> resolved at run-time. This implies that common symbols are now
> allowed in package libraries.
>
> What apparently is a problem is having the same entry point in  
> multiple
> dynamic libraries (we have had to deal with LSAME, NEWS item two  
> up).  I
> think this means that having arranged specially to satisfy symbols on
> MacOS, we now need to change it, so in src/extra/blas/Makefile.in
>
> Rblas_la_LIBADD = @RBLAS_LDFLAGS@ @DYLIB_UNDEFINED_ALLOWED_FALSE@ $ 
> (FLIBS)
>
> '@DYLIB_UNDEFINED_ALLOWED_FALSE@' needs to be '#'.
>
> and we may then need to link against $(FLIBS) elsewhere.
>
> We need Simon's input: to the rest of us the ever-increasing number of
> ways that MacOS needs special pampering is a mystery.
>
>> stefano
>>

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


Re: [Rd] configure on mac

2006-08-17 Thread roger koenker

On Aug 16, 2006, at 4:25 PM, Simon Urbanek wrote:

> On Aug 15, 2006, at 3:21 PM, roger koenker wrote:
>
> Sorry this, is my fault:
>
>>
>> ld: warning can't open dynamic library: libR.dylib referenced  
>> from: / Library/Frameworks/R.framework/Resources/lib/ 
>> libRlapack.dylib (checking for undefined symbols may be affected)
>
> ^^ the actual error is here - it cannot find libR
>
>> (No such file or directory, errno = 2)
>> ld: Undefined symbols:
>> _xerbla_ referenced from libRlapack expected to be defined in  
>> libR.dylib
>
> This is just a consequence of the above, _xerbla_ is not found as  
> it is defined libR which couldn't be loaded. The reason is that the  
> framework install didn't set the correct path in libRlapack. It is  
> now fixed in the current R-devel.
>
> The current R-devel now also checks the Xcode capabilities and will  
> fall-back to flat namespaces if the linker is too old (the other  
> error reported here). I tested some combinations of BLAS and tools,  
> but not all of them, so please drop me a line if you find a setup  
> that doesn't work.

Yes, R-devel_2006-08-16 now installs both packages I was having  
trouble with without any difficulties.
Thanks again!

Roger

>

url:www.econ.uiuc.edu/~rogerRoger Koenker
email[EMAIL PROTECTED]Department of Economics
vox: 217-333-4558University of Illinois
fax:   217-244-6678Champaign, IL 61820

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