Re: [Rd] Solved and Question: Problem with S3 method dispatch and NAMESPACE

2013-04-24 Thread Frank Harrell
Thank you very much Peter.  That did the trick.
Frank

Peter Dalgaard-2 wrote
> On Apr 24, 2013, at 15:59 , Frank Harrell wrote:
> 
>> I found that package quantreg has created a new generic for latex() [I
>> wish
>> it hadn't; this has been a generic in Hmisc for almost 2 decades].  When
>> I
>> require(quantreg) after loading rms, latex(anova.rms object) dispatches
>> latex.default, but everything is fine if I don't load quantreg.  rms has
>> import(Hmisc) in NAMESPACE and is loaded before quantreg, hence the
>> conflict.  How do I make the generic from Hmisc take precedence?
> 
> 
> library(quantreg, pos=x) with suitably large x is one idea.
> 
>> Thanks
>> Frank
>> 
>> Frank Harrell wrote
>>> I have updated the rms package to extensively use NAMESPACE.  I cannot
>>> get
>>> certain S3 methods to dispatch.  For example I have in NAMESPACE
>>> 
>>> S3method(anova, rms)
>>> S3method(latex, anova.rms)
>>> 
>>> anova.rms produces an object of class "anova.rms" and there is a
>>> latex.anova.rms function in rms.  But when I do latex(anova(fit)) I get
>>> an
>>> invocation of latex.default.
>>> 
>>> I have tried using "anova.rms" and `anova.rms` in S3method() to no
>>> avail.
>>> 
>>> Any help appreciated.  I'm using R 2.15.3
>>> Frank
>> 
>> 
>> 
>> 
>> 
>> -
>> Frank Harrell
>> Department of Biostatistics, Vanderbilt University
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/Problem-with-S3-method-dispatch-and-NAMESPACE-tp4665179p4665216.html
>> Sent from the R devel mailing list archive at Nabble.com.
>> 
>> __
>> 

> R-devel@

>  mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> -- 
> Peter Dalgaard, Professor
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: 

> pd.mes@

>   Priv: 

> PDalgd@

> 
> __

> R-devel@

>  mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel





-
Frank Harrell
Department of Biostatistics, Vanderbilt University
--
View this message in context: 
http://r.789695.n4.nabble.com/Problem-with-S3-method-dispatch-and-NAMESPACE-tp4665179p4665226.html
Sent from the R devel mailing list archive at Nabble.com.

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


Re: [Rd] Solved and Question: Problem with S3 method dispatch and NAMESPACE

2013-04-24 Thread peter dalgaard

On Apr 24, 2013, at 15:59 , Frank Harrell wrote:

> I found that package quantreg has created a new generic for latex() [I wish
> it hadn't; this has been a generic in Hmisc for almost 2 decades].  When I
> require(quantreg) after loading rms, latex(anova.rms object) dispatches
> latex.default, but everything is fine if I don't load quantreg.  rms has
> import(Hmisc) in NAMESPACE and is loaded before quantreg, hence the
> conflict.  How do I make the generic from Hmisc take precedence?


library(quantreg, pos=x) with suitably large x is one idea.

> Thanks
> Frank
> 
> Frank Harrell wrote
>> I have updated the rms package to extensively use NAMESPACE.  I cannot get
>> certain S3 methods to dispatch.  For example I have in NAMESPACE
>> 
>> S3method(anova, rms)
>> S3method(latex, anova.rms)
>> 
>> anova.rms produces an object of class "anova.rms" and there is a
>> latex.anova.rms function in rms.  But when I do latex(anova(fit)) I get an
>> invocation of latex.default.
>> 
>> I have tried using "anova.rms" and `anova.rms` in S3method() to no avail.
>> 
>> Any help appreciated.  I'm using R 2.15.3
>> Frank
> 
> 
> 
> 
> 
> -
> Frank Harrell
> Department of Biostatistics, Vanderbilt University
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Problem-with-S3-method-dispatch-and-NAMESPACE-tp4665179p4665216.html
> Sent from the R devel mailing list archive at Nabble.com.
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

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


[Rd] Solved and Question: Problem with S3 method dispatch and NAMESPACE

2013-04-24 Thread Frank Harrell
I found that package quantreg has created a new generic for latex() [I wish
it hadn't; this has been a generic in Hmisc for almost 2 decades].  When I
require(quantreg) after loading rms, latex(anova.rms object) dispatches
latex.default, but everything is fine if I don't load quantreg.  rms has
import(Hmisc) in NAMESPACE and is loaded before quantreg, hence the
conflict.  How do I make the generic from Hmisc take precedence?
Thanks
Frank

Frank Harrell wrote
> I have updated the rms package to extensively use NAMESPACE.  I cannot get
> certain S3 methods to dispatch.  For example I have in NAMESPACE
> 
> S3method(anova, rms)
> S3method(latex, anova.rms)
> 
> anova.rms produces an object of class "anova.rms" and there is a
> latex.anova.rms function in rms.  But when I do latex(anova(fit)) I get an
> invocation of latex.default.
> 
> I have tried using "anova.rms" and `anova.rms` in S3method() to no avail.
> 
> Any help appreciated.  I'm using R 2.15.3
> Frank





-
Frank Harrell
Department of Biostatistics, Vanderbilt University
--
View this message in context: 
http://r.789695.n4.nabble.com/Problem-with-S3-method-dispatch-and-NAMESPACE-tp4665179p4665216.html
Sent from the R devel mailing list archive at Nabble.com.

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